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(); }
public TreeNodeState(UnitTreeNode node) { this.fullPath = node.FullPath; this.isExpanded = node.IsExpanded; this.isVisible = node.IsVisible; this.isSelected = node.IsSelected; }
public void ClearResults(UnitTreeNode node) { if (node == null) { return; } this.clearNodeResults(node); }
private void clearNodeResults(UnitTreeNode node) { if (node == null) { return; } node.TestState = TestState.NotRun; foreach (UnitTreeNode child in node.Nodes) { this.clearNodeResults(child); } }
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); } }
public void UpdateNode(TreeNodeState old, UnitTreeNode node) { if (old.IsVisible) { node.EnsureVisible(); } if (old.IsExpanded) { node.Expand(); } if (old.IsSelected) { this.typeTree.SelectedNode = node; } }
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); } }
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; } }
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(); } }