async static private void CommandItem_Click(object sender, EventArgs e) { if (_proc != null) { return; } if (!(sender is CommandToolStripItem) || ((CommandToolStripItem)sender).CommandDef == null) { return; } IExplorerObject exObject = ((CommandToolStripItem)sender).ExplorerObject; XmlNode commandDef = ((CommandToolStripItem)sender).CommandDef; FormCommandParameters dlg = new FormCommandParameters(exObject, commandDef); if (dlg.ShowDialog() == DialogResult.OK) { //if (Standardoutput != null) Standardoutput.Text = ""; await RunProcess(dlg.Command, null); } }
static private void CommandItem_Click(object sender, EventArgs e) { if (_proc != null) { return; } if (!(sender is CommandToolStripItem) || ((CommandToolStripItem)sender).CommandDef == null) { return; } IExplorerObject exObject = ((CommandToolStripItem)sender).ExplorerObject; XmlNode commandDef = ((CommandToolStripItem)sender).CommandDef; FormCommandParameters dlg = new FormCommandParameters(exObject, commandDef); if (dlg.ShowDialog() == DialogResult.OK) { //if (Standardoutput != null) Standardoutput.Text = ""; Thread thread = new Thread(new ParameterizedThreadStart(RunProcess)); thread.Start(new CommandInterpregerArgs(dlg.Command)); } }