Ejemplo n.º 1
0
        public static void Start()
        {
            var root = new CategoryTreeLookup("Source1").GetSimpleMutableCategoryTree();

            Display(root);
            Display(root.PreOrder(n => n.Name != "ESRI"));
        }
Ejemplo n.º 2
0
        public static void Start()
        {
            var root = new CategoryTreeLookup("Source1").GetSimpleMutableCategoryTree();

            var sw = new Stopwatch();
            sw.Start();
            Start(root);
            sw.Stop();
            Console.WriteLine($"\n*** Post data-loaded elapsed time: {sw.Elapsed} ***");
        }
Ejemplo n.º 3
0
        public static void Start()
        {
            var root = new CategoryTreeLookup("Source1").GetSimpleMutableCategoryTree();

            Display(root);

            var destRoot = new SimpleMutableCategoryNode(root.Item);

            root.CopyTo(destRoot, n => n.Name != "Database");

            Display(destRoot);
        }
Ejemplo n.º 4
0
        public static void Start()
        {
            var dataRoot = new CategoryTreeLookup("Source2").GetCategoryDataTree();

            var mutableRoot =
                new MutableEntityTreeNode <long, CategoryItem>(CategoryEntityDefinition <CategoryItem> .Instance,
                                                               new CategoryItem(dataRoot.CategoryId, dataRoot.Name));

            mutableRoot.Build(dataRoot, x => new CategoryItem(x.CategoryId, x.Name));
            Display(mutableRoot);

            var readOnlyRoot =
                new ReadOnlyEntityTreeNode <long, CategoryItem>(CategoryEntityDefinition <CategoryItem> .Instance,
                                                                new CategoryItem(dataRoot.CategoryId, dataRoot.Name));

            readOnlyRoot.Build(dataRoot, x => new CategoryItem(x.CategoryId, x.Name));
            Display(readOnlyRoot);
        }
Ejemplo n.º 5
0
        public static void Start()
        {
            var root = new CategoryTreeLookup("Source1").GetSimpleMutableCategoryTree();

            Display(root);

            root[327].MoveToParent(325);
            Display(root);

            // should be exactly the same position
            root[326].MoveToParent(325, 0);
            Display(root);

            root[326].MoveToParent(325, 1);
            Display(root);

            root[327].MoveToParent(325, 2);
            Display(root);
        }