private Node(string text, Node parent) { this.Id = Guid.NewGuid().ToString(); this.Text = text; this.Parent = parent; this.Children = new SortedList<string, Node>(); }
static Node() { Root = new Node("Root", null); Root.Id = "#"; Nodes = new Dictionary<string, Node>(); }
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; }