public FilteredConnectablesGroup Add(ITECScope child) { FilteredConnectablesGroup newGroup = new FilteredConnectablesGroup(child, this.filter); this.Add(newGroup); return(newGroup); }
public void Add(FilteredConnectablesGroup child) { foreach (var pair in child.scopeDictionary) { this.scopeDictionary.Add(pair.Key, pair.Value); } child.scopeDictionary = this.scopeDictionary; child.PropertyChanged += childPropertyChanged; this.ChildrenGroups.Add(child); this.PassesFilter = thisPassesFilter(); }
public bool Remove(ITECScope child) { FilteredConnectablesGroup groupToRemove = scopeDictionary.ContainsKey(child) ? scopeDictionary[child] : null; if (groupToRemove == null) { return(false); } else { this.Remove(groupToRemove); return(true); } }
public bool Remove(FilteredConnectablesGroup child) { var moreChildren = new List <FilteredConnectablesGroup>(child.ChildrenGroups); foreach (var childGroup in moreChildren) { child.Remove(childGroup); } child.scopeDictionary = null; this.scopeDictionary.Remove(child.Scope); child.PropertyChanged -= childPropertyChanged; if (this.ChildrenGroups.Remove(child)) { this.PassesFilter = thisPassesFilter(); return(true); } else { return(false); } }