示例#1
0
        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);
            }
        }
示例#2
0
        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));
            }
        }