public static void ReadProcessOutput(ScmRepositoryProcess sfp) { while (!sfp.process.StandardOutput.EndOfStream) { var line = sfp.process.StandardOutput.ReadLine(); sfp.processOutput.Add(line); if (sfp.isUpdateCommand && (line.Length > 1)) { if (line.StartsWith("C ") || line.StartsWith("svn")) { sfp.updateError = true; } else if (line.StartsWith("Skipped ")) { sfp.updateError = true; } } } while (!sfp.process.StandardError.EndOfStream) { sfp.processOutput.Add(sfp.process.StandardError.ReadLine()); if (sfp.isUpdateCommand) { sfp.updateError = true; } } }
public UpdateLogsForm(ScmRepositoryProcess sfp) { if (!sfp.isUpdateCommand) throw new ApplicationException(); folderProcess = sfp; InitializeComponent(); FillList (); PlaySound (); }
public static void ReadProcessOutput(ScmRepositoryProcess sfp) { using (AutoResetEvent outputWaitHandle = new AutoResetEvent(false)) using (AutoResetEvent errorWaitHandle = new AutoResetEvent(false)) { sfp.process.OutputDataReceived += (sender, e) => { if (e.Data == null && !outputWaitHandle.SafeWaitHandle.IsClosed) { outputWaitHandle.Set(); } else { var line = e.Data; sfp.processOutput.Add(line); if (sfp.isUpdateCommand && (line.Length > 1)) { if (line.StartsWith("C ") || line.StartsWith("svn")) { sfp.updateError = true; } else if (line.StartsWith("Skipped ")) { sfp.updateError = true; } } } }; sfp.process.ErrorDataReceived += (sender, e) => { if (e.Data == null && !errorWaitHandle.SafeWaitHandle.IsClosed) { errorWaitHandle.Set(); } else { sfp.processOutput.Add(e.Data); if (sfp.isUpdateCommand) { sfp.updateError = true; } } }; sfp.process.BeginOutputReadLine(); sfp.process.BeginErrorReadLine(); outputWaitHandle.WaitOne(ExecutionTimeOut); errorWaitHandle.WaitOne(ExecutionTimeOut); } }
public UpdateLogsForm(ScmRepositoryProcess sfp) { if (!sfp.isUpdateCommand) { throw new ApplicationException(); } folderProcess = sfp; InitializeComponent(); FillList(); PlaySound(); }
private void ShowUpdateErrors(ScmRepositoryProcess sfp) { new UpdateLogsForm (sfp).ShowDialog (this); }
public static void ReadProcessOutput(ScmRepositoryProcess sfp) { while (!sfp.process.StandardOutput.EndOfStream) { var line = sfp.process.StandardOutput.ReadLine(); sfp.processOutput.Add(line); if (sfp.isUpdateCommand && (line.Length > 1)) { if (line.StartsWith("C ") || line.StartsWith("svn")) sfp.updateError = true; else if (line.StartsWith("Skipped ")) sfp.updateError = true; } } while (!sfp.process.StandardError.EndOfStream) { sfp.processOutput.Add(sfp.process.StandardError.ReadLine()); if (sfp.isUpdateCommand) sfp.updateError = true; } }
private void ShowUpdateErrors(ScmRepositoryProcess sfp) { new UpdateLogsForm(sfp).ShowDialog(this); }