Ejemplo n.º 1
0
        public static FileSystemConsoleProcess Start(string executablePath, string processArguments, ICrashReportFinder crashReportFinder)
        {
            Process osProcess = new Process
            {
                StartInfo = new ProcessStartInfo(executablePath)
                {
                    UseShellExecute        = false,
                    RedirectStandardInput  = true,
                    RedirectStandardOutput = true,
                    RedirectStandardError  = true,
                    CreateNoWindow         = true,
                    ErrorDialog            = false,
                    Arguments = processArguments
                },
                EnableRaisingEvents = true
            };

            osProcess.Start();
            osProcess.BeginOutputReadLine();
            osProcess.BeginErrorReadLine();

            FileSystemConsoleProcess process = new FileSystemConsoleProcess(executablePath, osProcess, crashReportFinder);

            return(process);
        }
 public IConsoleProcess StartProcess(string processArguments) =>
 FileSystemConsoleProcess.Start(ExecutablePath, processArguments, CrashReportFinder);