Exemplo n.º 1
0
        public Node AddChild(char c)
        {
            Node childNode;

            if (Childs.ContainsKey(c))
            {
                childNode = Childs[c];
            }
            else
            {
                childNode = new Node(c);
                Childs.Add(c, childNode);
            }
            return(childNode);
        }
 private void addPathedValue(string path, object value)
 {
     if (path.StartsWith("/"))
     {
         path = path.Substring(1);
     }
     if (path.Contains('/'))
     {
         string[] parts = path.Split(new char[] { '/' }, 2);
         if (!Childs.ContainsKey(parts[0]))
         {
             childs.Add(parts[0], new ChangesetBranch(new Dictionary <string, ChangeSet>()));
         }
         var child = (ChangesetBranch)(Childs[parts[0]]);
         child.addPathedValue(parts[1], value);
     }
     else
     {
         childs[path] = new ChangeSetLeaf(value);
     }
 }