예제 #1
0
        public void Restore(TestSuiteTreeView treeView)
        {
            treeView.CheckBoxes = this.ShowCheckBoxes;

            foreach (VisualTreeNode visualNode in this.Nodes)
            {
                TestSuiteTreeNode treeNode = treeView[visualNode.UniqueName];
                if (treeNode != null)
                {
                    if (treeNode.IsExpanded != visualNode.Expanded)
                    {
                        treeNode.Toggle();
                    }

                    treeNode.Checked = visualNode.Checked;
                }
            }

            if (this.SelectedNode != null)
            {
                TestSuiteTreeNode treeNode = treeView[this.SelectedNode];
                if (treeNode != null)
                {
                    treeView.SelectedNode = treeNode;
                }
            }

            if (this.TopNode != null)
            {
                TestSuiteTreeNode treeNode = treeView[this.TopNode];
                if (treeNode != null)
                {
                    treeView.TopNode = treeNode;
                }
            }

            if (this.SelectedCategories != null)
            {
                TestFilter filter = new CategoryFilter(this.SelectedCategories.Split(new char[] { ',' }));
                if (this.ExcludeCategories)
                {
                    filter = new NotFilter(filter);
                }
                treeView.CategoryFilter = filter;
            }

            treeView.Select();
        }
예제 #2
0
        public void Restore(TestSuiteTreeView tree)
        {
            TestSuiteTreeNode treeNode = tree[this.UniqueName];

            if (treeNode != null)
            {
                if (treeNode.IsExpanded != this.Expanded)
                {
                    treeNode.Toggle();
                }

                treeNode.Checked = this.Checked;

                if (this.Nodes != null)
                {
                    foreach (VisualTreeNode childNode in this.Nodes)
                    {
                        childNode.Restore(tree);
                    }
                }
            }
        }