public void Set(Path path, NodeValueType value) { PathTreeNodeInternal current = root; foreach (PathElement pe in path.PathElements) { current.AddChild(pe, out current); } current.Value = value; current.Resolvable = true; }
public bool AddChild(PathElement pe, out PathTreeNodeInternal child) { child = Step(pe); if (child == null) { child = new PathTreeNodeInternal(); child.Parent = this; child.LocalPath = pe; Children.Add(pe, child); return(true); } return(false); }
private PathTreeNodeInternal getNode(Path path) { PathTreeNodeInternal current = root; foreach (PathElement pe in path.PathElements) { current = current.Step(pe); if (current == null) { return(null); } } return(current); }
public void Remove(Path path) { PathTreeNodeInternal node = getNode(path); if (node != null) { PathElement childPath; PathTreeNodeInternal valueParent = node.FindNextValueParent(out childPath); if (valueParent != null) { valueParent.Children.Remove(childPath); } } }
public PathTreeNodeInternal FindNextValueParent(out PathElement childPath) { childPath = LocalPath; PathTreeNodeInternal current = Parent; while (current.Resolvable == false && current.Parent != null) { childPath = current.LocalPath; current = current.Parent; } if (current.Resolvable) { return(current); } else { return(null); } }
public void Clear() { root = new PathTreeNodeInternal(); }
internal PathTreeNode(PathTreeNodeInternal capsuledNode) { this.capsuledNode = capsuledNode; }