private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeAdvMouseEventArgs e) { var node = e.Node.Tag as Node; toolToExecute = node.Tag as IModelTool; tabControlCmd.SelectedTab = tabPageCommand; if (toolToExecute != null) { propertyGrid1.SelectedObject = toolToExecute; } }
private static void BwDoWork(object sender, DoWorkEventArgs e) { object[] threadParameter = e.Argument as object[]; if (threadParameter == null) { return; } IModelTool toolToExecute = threadParameter[0] as IModelTool; ToolProgress progForm = threadParameter[1] as ToolProgress; if (progForm == null) { return; } if (toolToExecute == null) { return; } progForm.Progress(String.Empty, 0, "=================="); progForm.Progress(String.Empty, 0, String.Format("Executing Tool: {0}", toolToExecute.Name)); progForm.Progress(String.Empty, 0, "=================="); try { toolToExecute.Execute(progForm); } catch (Exception ex) { progForm.Progress(String.Empty, 100, "Failed to run. Errors:" + ex.Message); } finally { progForm.ExecutionComplete(); progForm.Progress(String.Empty, 100, "=================="); progForm.Progress(String.Empty, 100, String.Format("Done Executing Tool: {0}", toolToExecute.Name)); progForm.Progress(String.Empty, 100, "=================="); } }