public ScopeGroup GetGroup(ITECScope scope) { //if (this.Scope == scope) //{ // return this; //} //foreach (ScopeGroup group in this.ChildrenGroups) //{ // ScopeGroup childGroup = group.GetGroup(scope); // if (childGroup != null) // { // return childGroup; // } //} if (scope == null) { return(null); } if (this.scopeDictionary.ContainsKey(scope)) { return(scopeDictionary[scope]); } else { return(null); } }
public ScopeGroup Add(ITECScope child) { ScopeGroup newGroup = new ScopeGroup(child); this.Add(newGroup); return(newGroup); }
public FilteredConnectablesGroup Add(ITECScope child) { FilteredConnectablesGroup newGroup = new FilteredConnectablesGroup(child, this.filter); this.Add(newGroup); return(newGroup); }
public FilteredConnectablesGroup GetGroup(ITECScope scope) { if (scope == null) { return(null); } if (this.scopeDictionary.ContainsKey(scope)) { return(scopeDictionary[scope]); } else { return(null); } //if (this.Scope == scope) //{ // return this; //} //foreach (FilteredConnectablesGroup group in this.ChildrenGroups) //{ // FilteredConnectablesGroup childGroup = group.GetGroup(scope); // if (childGroup != null) // { // return childGroup; // } //} //return null; }
public ScopeGroup(ITECScope scope) : this(scope.Name) { this.Scope = scope; scopeDictionary.Add(scope, this); this.Scope.PropertyChanged += (sender, e) => { if (e.PropertyName == "Name") { Name = scope.Name; } }; }
public bool Remove(ITECScope child) { ScopeGroup groupToRemove = scopeDictionary.ContainsKey(child) ? scopeDictionary[child] : null; if (groupToRemove == null) { return(false); } else { this.Remove(groupToRemove); return(true); } }
public FilteredConnectablesGroup(ITECScope scope, ConnectableFilter filter) : this(scope.Name, filter) { this.Scope = scope; scopeDictionary.Add(scope, this); this.Scope.PropertyChanged += (sender, e) => { if (e.PropertyName == "Name") { Name = scope.Name; } }; if (scope is IConnectable connectable) { this.PassesFilter = filter.PassesFilter(connectable); } else { this.PassesFilter = false; } }
public List <ScopeGroup> GetPath(ITECScope scope) { List <ScopeGroup> path = new List <ScopeGroup>(); if (this.Scope == scope) { path.Add(this); return(path); } foreach (ScopeGroup childGroup in this.ChildrenGroups) { List <ScopeGroup> childPath = childGroup.GetPath(scope); if (childPath.Count > 0) { path.Add(this); path.AddRange(childPath); return(path); } } return(path); }