Пример #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);
 }