Beispiel #1
0
        private Process StartProcess(string cmd,
			Action<string> output,
			Action<string> errors,
			Action<int, Process> exited)
        {
            var start = new ProcessStartInfo
            {
                FileName = sp.FullName,
                WorkingDirectory = ProjectDirectory,
                CreateNoWindow = true,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                RedirectStandardInput = true,
                Arguments = cmd
            };

            var process = new Process();
            process.StartInfo = start;
            process.EnableRaisingEvents = true;
            process.Start ();
            process.StartReadAsync (output, errors, exited);
            jobs.Add (new Job (process.Handle));
            return process;
        }