Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
                }
            }
        }
Esempio n. 5
0
            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);
                }
            }
Esempio n. 6
0
 public void Clear()
 {
     root = new PathTreeNodeInternal();
 }
Esempio n. 7
0
 internal PathTreeNode(PathTreeNodeInternal capsuledNode)
 {
     this.capsuledNode = capsuledNode;
 }