Beispiel #1
0
        public void RemoveChild(QAliberTreeNode node)
        {
            FolderTestCase folderCase      = this.testcase as FolderTestCase;
            TestCase       caseToBeRemoved = node.Testcase;

            if (folderCase != null && caseToBeRemoved != null)
            {
                Nodes.Remove(node);
                folderCase.Children.Remove(caseToBeRemoved);
            }
        }
Beispiel #2
0
        public void InsertChild(int index, QAliberTreeNode node)
        {
            FolderTestCase folderCase = this.testcase as FolderTestCase;

            if (folderCase != null)
            {
                Nodes.Insert(index, node);
                folderCase.Children.Insert(index, node.Testcase);
                node.Testcase.Scenario = folderCase.Scenario;
                node.Testcase.Parent   = folderCase;
            }
        }
Beispiel #3
0
        public void AddChild(QAliberTreeNode child)
        {
            FolderTestCase folderCase = this.testcase as FolderTestCase;

            if (folderCase != null)
            {
                Nodes.Add(child);
                folderCase.Children.Add(child.Testcase);
                child.Testcase.Scenario = folderCase.Scenario;
                child.Testcase.Parent   = folderCase;
            }
        }
Beispiel #4
0
        private void AfterDragEnded(object sender, NodeDraggedEventArgs e)
        {
            FolderTestCase testcase = e.TargetNode.Testcase as FolderTestCase;

            if (testcase != null)
            {
                ICommand command = new CutCommand(new QAliberTreeNode[] { (QAliberTreeNode)e.SourceNode });
                command.Do();
                command = new PasteCommand(e.TargetNode);
                commandsHistory.Do(command);
                OnScenarioChanged();
            }
        }
Beispiel #5
0
        private void FillTreeRecursively(QAliberTreeNode node)
        {
            FolderTestCase folderCase = node.Testcase as FolderTestCase;

            if (folderCase != null)
            {
                foreach (TestCase child in folderCase.Children)
                {
                    QAliberTreeNode childNode = AddNode(node, child);
                    FillTreeRecursively(childNode);
                }
            }
        }
Beispiel #6
0
        public void InsertChild(int index, TestCase testCase)
        {
            FolderTestCase folderCase = this.testcase as FolderTestCase;

            if (testCase != null)
            {
                QAliberTreeNode node = new QAliberTreeNode(testCase);

                Nodes.Insert(index, node);
                folderCase.Children.Insert(index, testCase);
                testCase.Scenario = folderCase.Scenario;
                testCase.Parent   = folderCase;
            }
        }
Beispiel #7
0
        public void AddChild(TestCase testCase)
        {
            FolderTestCase folderCase = this.testcase as FolderTestCase;

            if (testCase != null)
            {
                QAliberTreeNode node = new QAliberTreeNode(testCase);

                Nodes.Add(node);
                folderCase.Children.Add(testCase);
                testCase.Scenario = folderCase.Scenario;
                testCase.Parent   = folderCase;
            }
        }
Beispiel #8
0
        public QAliberTreeNode LinkChild(TestCase testCase)
        {
            FolderTestCase folderCase = this.testcase as FolderTestCase;

            if (testCase != null)
            {
                QAliberTreeNode node = new QAliberTreeNode(testCase);

                Nodes.Add(node);
                testCase.Scenario = folderCase.Scenario;
                testCase.Parent   = folderCase;
                return(node);
            }
            return(null);
        }
Beispiel #9
0
        private void UpdateTags(QAliberTreeNode node, TestCase testcase)
        {
            node.Testcase = testcase;
            FolderTestCase folder = testcase as FolderTestCase;

            if (folder != null)
            {
                if (node.Nodes.Count == folder.Children.Count)
                {
                    for (int i = 0; i < folder.Children.Count; i++)
                    {
                        UpdateTags((QAliberTreeNode)node.Nodes[i], folder.Children[i]);
                    }
                }
            }
        }