public static void ApplyToolSelection( string progid, Dictionary <string, string> workflowParameters, CyPhyGUIs.InterpreterResult interpreterResult, CyPhyGUIs.IInterpreterMainParameters interpreterMainParameters, bool modifyLabels = true) { string toolName; workflowParameters.TryGetValue(AnalysisTool.ParameterNameInWorkflow, out toolName); if (string.IsNullOrEmpty(toolName) || toolName == "Default") { return; } var tool = GetByName(toolName); if (tool == null) { throw new ApplicationException(String.Format("Error: analysis tool \"{0}\" is not registered", toolName)); } // copy tool.OutputDirectory to generated directory MethodDelegateCopy toolOutputDirCopy = new MethodDelegateCopy(DirectoryCopy); IAsyncResult ar = toolOutputDirCopy.BeginInvoke(Path.Combine(tool.InstallLocation, tool.OutputDirectory), interpreterMainParameters.OutputDirectory, true, null, null); toolOutputDirCopy.EndInvoke(ar); interpreterResult.RunCommand = tool.RunCommand; if (modifyLabels) { interpreterResult.Labels += " && " + tool.Name; } }
public static void ApplyToolSelection( string progid, Dictionary<string, string> workflowParameters, CyPhyGUIs.InterpreterResult interpreterResult, CyPhyGUIs.IInterpreterMainParameters interpreterMainParameters, bool modifyLabels=true) { string toolName; workflowParameters.TryGetValue(AnalysisTool.ParameterNameInWorkflow, out toolName); if (string.IsNullOrEmpty(toolName) || toolName == "Default") { return; } var tool = GetByName(toolName); if (tool == null) { return; } // copy tool.OutputDirectory to generated directory MethodDelegateCopy toolOutputDirCopy = new MethodDelegateCopy(DirectoryCopy); IAsyncResult ar = toolOutputDirCopy.BeginInvoke(Path.Combine(tool.InstallLocation, tool.OutputDirectory), interpreterMainParameters.OutputDirectory, true, null, null); toolOutputDirCopy.EndInvoke(ar); interpreterResult.RunCommand = tool.RunCommand; if (modifyLabels) { interpreterResult.Labels += " && " + tool.Name; } }