예제 #1
0
        public static void Start()
        {
            var root = new CategoryTreeLookup("Source1").GetSimpleMutableCategoryTree();

            Display(root);
            Display(root.PreOrder(n => n.Name != "ESRI"));
        }
예제 #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} ***");
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }