Exemplo n.º 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();
        }
Exemplo n.º 2
0
 public TreeNodeState(UnitTreeNode node)
 {
     this.fullPath   = node.FullPath;
     this.isExpanded = node.IsExpanded;
     this.isVisible  = node.IsVisible;
     this.isSelected = node.IsSelected;
 }
Exemplo n.º 3
0
 public void ClearResults(UnitTreeNode node)
 {
     if (node == null)
     {
         return;
     }
     this.clearNodeResults(node);
 }
Exemplo n.º 4
0
 private void clearNodeResults(UnitTreeNode node)
 {
     if (node == null)
     {
         return;
     }
     node.TestState = TestState.NotRun;
     foreach (UnitTreeNode child in node.Nodes)
     {
         this.clearNodeResults(child);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 8
0
 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;
     }
 }
Exemplo n.º 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();
            }
        }