private CheckTree AddOrCreateSubgroup(string Name) { CheckTreeNode Subgroup = null; if (Children_.TryGetValue(Name, out Subgroup)) { System.Diagnostics.Debug.Assert(Subgroup is CheckTree); return((CheckTree)Subgroup); } CheckTree SG = new CheckTree(Name, this); Children_[Name] = SG; return(SG); }
private CheckTree LocateCheckLeafGroup(string Check, out string LeafName) { string[] Components = Check.Split('-'); string FirstComponent = Components.FirstOrDefault(); if (FirstComponent == null) { LeafName = Check; return(this); } CheckTreeNode Subgroup = null; if (!Children_.TryGetValue(FirstComponent, out Subgroup)) { LeafName = Check; return(this); } System.Diagnostics.Debug.Assert(Subgroup is CheckTree); CheckTree Child = (CheckTree)Subgroup; string ChildName = Check.Substring(FirstComponent.Length + 1); return(Child.LocateCheckLeafGroup(ChildName, out LeafName)); }
protected CheckTreeNode(string Name, CheckTreeNode Parent) { Name_ = Name; Parent_ = Parent; }