예제 #1
0
        public void CreateChild(string textBranch, string textLeaf)
        {
            CompositeC composite = (CompositeC)Tree[textBranch];
            Leaf       leaf      = (Leaf)Tree[textLeaf];

            composite.Add(leaf);
        }
예제 #2
0
        public static void RecursiveInit()
        {
            int[] array = null;

            array = new int[16]
            {
                                   1, 2, 3, 4,
                                   5, 6, 7, 8, 9,
                                   10, 11, 12, 13,
                                   14, 15, 16
            };

            Component tree = new CompositeC("root");
            tree.RecursiveBuild(array);
            CompositeC tree2 = tree as CompositeC;
            tree.Operation();
        }
예제 #3
0
        public static void RecursiveInit()
        {
            int[] array = null;

            array = new int[16]
            {
                1, 2, 3, 4,
                5, 6, 7, 8, 9,
                10, 11, 12, 13,
                14, 15, 16
            };

            Component tree = new CompositeC("root");

            tree.RecursiveBuild(array);
            CompositeC tree2 = tree as CompositeC;

            tree.Operation();
        }
예제 #4
0
        public void CreateLeaf(string text)
        {
            Component leaf = new CompositeC(text);

            Tree.Add(text, leaf);
        }
예제 #5
0
        public void CreateBranch(string text)
        {
            Component branch1 = new CompositeC(text);

            Tree.Add(text, branch1);
        }
예제 #6
0
 public void CreateLeaf(string text)
 {
     Component leaf = new CompositeC(text);
     Tree.Add(text, leaf);
 }
예제 #7
0
 public void CreateBranch(string text)
 {
     Component branch1 = new CompositeC(text);
     Tree.Add(text, branch1);
 }