예제 #1
0
        private void DisplaySelectedNodeResult()
        {
            this.textBox.Text = "";
            UnitTreeNode node = this.tree.TypeTree.SelectedNode as UnitTreeNode;

            if (node == null)
            {
                return;
            }

            ReportRun result = this.tree.TestDomains.GetResult(node);

            if (result != null)
            {
                switch (this.consoleStream)
                {
                case ConsoleStream.Out:
                    this.textBox.Text = result.ConsoleOut;
                    break;

                case ConsoleStream.Error:
                    this.textBox.Text = result.ConsoleError;
                    break;
                }
            }
            this.Refresh();
        }
예제 #2
0
 public TreeNodeState(UnitTreeNode node)
 {
     this.fullPath   = node.FullPath;
     this.isExpanded = node.IsExpanded;
     this.isVisible  = node.IsVisible;
     this.isSelected = node.IsSelected;
 }
예제 #3
0
 public void ClearResults(UnitTreeNode node)
 {
     if (node == null)
     {
         return;
     }
     this.clearNodeResults(node);
 }
예제 #4
0
 private void clearNodeResults(UnitTreeNode node)
 {
     if (node == null)
     {
         return;
     }
     node.TestState = TestState.NotRun;
     foreach (UnitTreeNode child in node.Nodes)
     {
         this.clearNodeResults(child);
     }
 }
예제 #5
0
 public void ExpandState(UnitTreeNode node, TestState state)
 {
     if (node == null)
     {
         return;
     }
     if (node.TestState == state)
     {
         node.EnsureVisible();
     }
     foreach (UnitTreeNode child in node.Nodes)
     {
         ExpandState(child, state);
     }
 }
예제 #6
0
 public void UpdateNode(TreeNodeState old, UnitTreeNode node)
 {
     if (old.IsVisible)
     {
         node.EnsureVisible();
     }
     if (old.IsExpanded)
     {
         node.Expand();
     }
     if (old.IsSelected)
     {
         this.typeTree.SelectedNode = node;
     }
 }
예제 #7
0
        private void DisplaySelectedNodeResult()
        {
            // retreive current exceptoin
            this.exceptionTreeView.Nodes.Clear();
            this.textBox1.Text = "";
            UnitTreeNode node = this.tree.TypeTree.SelectedNode as UnitTreeNode;

            if (node == null)
            {
                return;
            }

            ReportRun result = this.Tree.TestDomains.GetResult(node);

            if (result != null && result.Result == ReportRunResult.Failure)
            {
                AddException(result.Exception);
            }
        }
예제 #8
0
파일: MainWindow.cs 프로젝트: Netkidxp/TPLC
 private void OnPostTreeViewItemSelected(object sender, TreeViewEventArgs e)
 {
     if (e.Node is UnitTreeNode)
     {
         UnitTreeNode utn = e.Node as UnitTreeNode;
         pgMain.SelectedObject = utn.Property;
         //fdvMain.Render();
     }
     else
     {
         pgMain.SelectedObject = null;
         //fdvMain.Render();
     }
     if (e.Node.Text == "Pressure Drop")
     {
         PressureDropProperty pdp = new PressureDropProperty();
         pdp.UnitManager       = fdvMain.UnitManager;
         pgMain.SelectedObject = pdp;
     }
 }
예제 #9
0
        public void RunTests()
        {
            try
            {
                // clearing nodes
                this.MessageOnStatusBar("Clearing results");
                this.Invoke(new MethodInvoker(this.ClearSelectedResults));

                OnStartTests();
                this.MessageOnStatusBar("Starting tests");
                UnitTreeNode selectedNode = (UnitTreeNode)
                                            this.Invoke(new UnitTreeNodeMethodInvoker(this.GetSelectTreeNode));
                if (selectedNode == null)
                {
                    this.TestDomains.RunPipes();
                }
                else
                {
                    this.TestDomains.RunPipes(selectedNode);
                }
                this.MessageOnStatusBar("Finished tests");
            }
            catch (Exception ex)
            {
                if (ex is System.Threading.ThreadAbortException)
                {
                    return;
                }

                MessageBox.Show(ex.ToString());
                this.MessageOnStatusBar("Test execution failed: " + ex.Message);
            }
            finally
            {
                OnFinishTests();
            }
        }