public AutoCacheConditionViewModel(CacheSettings cacheSettings, TagCondition tagCondition) { TagCondition = tagCondition; Label = tagCondition.ToReactivePropertyAsSynchronized(x => x.Label); IncludeTags = tagCondition.IncludeTags; ExcludeTags = tagCondition.ExcludeTags; IncludeTagText = new ReactiveProperty <string>(""); ExcludeTagText = new ReactiveProperty <string>(""); AddIncludeTagCommand = IncludeTagText.Select(x => x.Length > 0) .ToReactiveCommand(); AddIncludeTagCommand.Subscribe(x => { if (AddIncludeTag(IncludeTagText.Value)) { IncludeTagText.Value = ""; } }); AddExcludeTagCommand = ExcludeTagText.Select(x => x.Length > 0) .ToReactiveCommand(); AddExcludeTagCommand.Subscribe(x => { if (AddExcludeTag(ExcludeTagText.Value)) { ExcludeTagText.Value = ""; } }); RemoveIncludeTagCommand = new DelegateCommand <string>(x => RemoveIncludeTag(x)); RemoveExcludeTagCommand = new DelegateCommand <string>(x => RemoveExcludeTag(x)); }
public ConnectionTag FirstMatch(TagCondition cond) { foreach (ConnectionTag ct in _connections) { if (cond(ct)) { return(ct); } } return(null); }
public ConnectionTag FirstMatch(TagCondition cond) { foreach(ConnectionTag ct in _connections) { if(cond(ct)) return ct; } return null; }
protected bool Equals(TagCondition other) { return(string.Equals(Tag, other.Tag)); }