Ejemplo n.º 1
0
        public void ExceptionWhenTwoNodePresentersUseTheSameNodeTagType()
        {
            var treeView = new TreeView();

            var parentNodePresenter1 = new ParentNodePresenter();
            var parentNodePresenter2 = new ParentNodePresenter();

            treeView.NodePresenters.Add(parentNodePresenter1);
            treeView.NodePresenters.Add(parentNodePresenter2);
        }
Ejemplo n.º 2
0
        public void RefreshShouldNotRefreshNodesWhichAreNotLoaded()
        {
            var treeView = new TreeView();

            var parent = new Parent {
                Name = "parent1"
            };
            var child = new Child();

            parent.Children.Add(child);

            var parentNodePresenter = new ParentNodePresenter();
            var childNodePresenter  = new ChildNodePresenter();

            treeView.NodePresenters.Add(parentNodePresenter);
            treeView.NodePresenters.Add(childNodePresenter);

            childNodePresenter.AfterUpdate += delegate { Assert.Fail("Child nodes which are not loaded should not be updated"); };

            treeView.Refresh();
        }