Beispiel #1
0
 public MainPage(Utils.CTree <string> tree, int level)
 {
     InitializeComponent();
     this.Tree = tree;
     Level     = level;
     CreatePagesTree();
 }
Beispiel #2
0
        public static CTree <string> GetTree()
        {
            CTree <string> root = new CTree <string>("Root", null, "Root");
            Action <CTree <string>, int> createtree = null;

            createtree = (CTree <string> tree, int level) => {
                if (level == 0)
                {
                    return;
                }
                for (int i = 0; i < 8; i++)
                {
                    var child = new CTree <string>($"Page:{i + 1}", tree, (i + 1).ToString());
                    tree.Children.AddLast(child);
                    createtree(child, level - 1);
                }
            };
            createtree(root, 5);
            return(root);
        }
Beispiel #3
0
 public CTree(T info, CTree <T> parent, string name)
 {
     Info   = info;
     Parent = parent;
     Name   = name;
 }