コード例 #1
0
 internal TestTreeNode Add(string name, Dictionary<string, TestTreeNode> dictionary)
 {
     var result = new TestTreeNode(name, dictionary);
     Children.Add(result);
     result.Parent = this;
     return result;
 }
コード例 #2
0
 internal void Add(Dictionary<string, TestTreeNode> dictionary, params string[] names)
 {
     foreach (var name in names)
     {
         var node = new TestTreeNode(name, dictionary);
         Children.Add(node);
         node.Parent = this;
     }
 }
コード例 #3
0
        public TreeNodeProvider(string referenceId)
            : base(referenceId)
        {
            TestTreeNode._count = 0;

            _nodes = new Dictionary<string, TestTreeNode>();

            var knud = new TestTreeNode("Knud", _nodes);
            knud.Add(_nodes, "Louise", "Rikke", "Sofie", "Jeppe");
            var louise = knud.Children.First();
            louise.Add(_nodes, "Mathias", "Kasper", "Rasmus");
            var jeppe = knud.Children.Last();
            jeppe.Add(_nodes, "Villads", "Emma");
        }