示例#1
0
        private void RunExternalCommand(ShellCommand command, ShellContext context)
        {
            var process = new Process();

            process.StartInfo = new ProcessStartInfo()
            {
                FileName  = command.CommandName,
                Arguments = command.ArgumentsAsString
            };

            if (command.IsJob)
            {
                context.AddJob(new ShellJob(process));
            }
            else
            {
                process.Start();
                process.WaitForExit();
            }
        }