Esempio n. 1
0
 private Node(string text, Node parent)
 {
     this.Id = Guid.NewGuid().ToString();
     this.Text = text;
     this.Parent = parent;
     this.Children = new SortedList<string, Node>();
 }
Esempio n. 2
0
 static Node()
 {
     Root = new Node("Root", null);
     Root.Id = "#";
     Nodes = new Dictionary<string, Node>();
 }
Esempio n. 3
0
 public static Node Register(DN dn, IMBean obj)
 {
     Node node = Node.Root;
     lock (Nodes)
     {
         foreach (RDN rdn in dn.RDNs)
         {
             string nodeText = null;
             foreach (RDNComponent comp in rdn.Components)
             {
                 nodeText = comp.ComponentType + "=" + comp.ComponentValue;
                 break;
             }
             if (node.Children.ContainsKey(nodeText))
             {
                 node = node.Children[nodeText];
             }
             else
             {
                 Node newNode = new Node(nodeText, node);
                 node.Children.Add(newNode.Text, newNode);
                 Node.Nodes.Add(newNode.Id, newNode);
                 node = newNode;
             }
         }
     }
     node.Payload = obj;
     return node;
 }