Version 3.0.260

This commit is contained in:
Oliver Hauff 2021-11-07 21:28:13 +01:00
parent 5a26bf273b
commit 4df8aa98aa
134 changed files with 8098 additions and 567 deletions

View file

@ -26,6 +26,7 @@ namespace TINK.ViewModel.Map
{
return this.Where(x => x.Value == FilterState.On).Select(x => x.Key).ToList();
}
/// <summary> Performs filtering on response-group. </summary>
public IEnumerable<string> DoFilter(IEnumerable<string> filter = null) => Filter.DoFilter(filter);
@ -41,20 +42,11 @@ namespace TINK.ViewModel.Map
public bool IsReadOnly => true;
public void Add(string key, FilterState value)
{
throw new System.NotImplementedException();
}
public void Add(string key, FilterState value) => throw new System.NotImplementedException();
public void Add(KeyValuePair<string, FilterState> item) => throw new System.NotImplementedException();
public void Add(KeyValuePair<string, FilterState> item)
{
throw new System.NotImplementedException();
}
public void Clear()
{
throw new System.NotImplementedException();
}
public void Clear() => throw new System.NotImplementedException();
public bool Contains(KeyValuePair<string, FilterState> item) => FilterDictionary.Contains(item);
@ -64,15 +56,9 @@ namespace TINK.ViewModel.Map
public IEnumerator<KeyValuePair<string, FilterState>> GetEnumerator() => FilterDictionary.GetEnumerator();
public bool Remove(string key)
{
throw new System.NotImplementedException();
}
public bool Remove(string key) => throw new System.NotImplementedException();
public bool Remove(KeyValuePair<string, FilterState> item)
{
throw new System.NotImplementedException();
}
public bool Remove(KeyValuePair<string, FilterState> item) => throw new System.NotImplementedException();
public bool TryGetValue(string key, out FilterState value) => FilterDictionary.TryGetValue(key, out value);

View file

@ -3,7 +3,9 @@ using TINK.Model;
namespace TINK.ViewModel.Map
{
public interface IGroupFilterMapPage : IDictionary<string, FilterState>
/// <summary> Interface for filtering. </summary>
/// <remarks> Holds a dictionary of filters which might or might not be appield depending on filter state.</remarks>
public interface IGroupFilterMapPage : IDictionary<string /* Filter*/, FilterState /* on or off*/>
{
/// <summary> Performs filtering on response-group. </summary>
IEnumerable<string> DoFilter(IEnumerable<string> filter = null);

View file

@ -2,6 +2,7 @@
using System.Linq;
using TINK.Model;
using TINK.Model.Connector;
using TINK.Model.Connector.Filter;
using Xamarin.Forms;
namespace TINK.ViewModel.Map
@ -28,21 +29,21 @@ namespace TINK.ViewModel.Map
}
/// <summary> Gets value whether TINK is enabled or not. </summary>
public bool IsTinkEnabled => !string.IsNullOrEmpty(CurrentFilter) && CurrentFilter != FilterHelper.FILTERTINKGENERAL;
public bool IsTinkEnabled => !string.IsNullOrEmpty(CurrentFilter) && CurrentFilter.GetBikeCategory() != FilterHelper.FILTERTINKGENERAL;
/// <summary> Gets color of the TINK button. </summary>
public Color TinkColor => CurrentFilter == FilterHelper.FILTERTINKGENERAL ? Color.Blue : Color.Gray;
public Color TinkColor => CurrentFilter.GetBikeCategory() == FilterHelper.FILTERTINKGENERAL ? Color.Blue : Color.Gray;
/// <summary> Gets value whether Konrad is enabled or not. </summary>
public bool IsKonradEnabled => !string.IsNullOrEmpty(CurrentFilter) && CurrentFilter != FilterHelper.FILTERKONRAD;
public bool IsKonradEnabled => !string.IsNullOrEmpty(CurrentFilter) && CurrentFilter.GetBikeCategory() != FilterHelper.FILTERKONRAD;
/// <summary> Gets color of the Konrad button. </summary>
public Color KonradColor => CurrentFilter == FilterHelper.FILTERKONRAD ? Color.Red : Color.Gray;
public Color KonradColor => CurrentFilter.GetBikeCategory() == FilterHelper.FILTERKONRAD ? Color.Red : Color.Gray;
/// <summary> Gets whether toggle functionality is visible or not. </summary>
public bool IsToggleVisible =>
FilterDictionary.ContainsKey(FilterHelper.FILTERKONRAD)
&& FilterDictionary.ContainsKey(FilterHelper.FILTERTINKGENERAL)
FilterDictionary.Select(x => x.Key).ContainsGroupId(FilterHelper.FILTERKONRAD)
&& FilterDictionary.Select(x => x.Key).ContainsGroupId(FilterHelper.FILTERTINKGENERAL)
&& (IsTinkEnabled || IsKonradEnabled);
/// <summary>