private void UpdateControlStates(bool priorityToRedirect) { bool bothChecked = (this.RedirectStreams != RedirectStandardStreams.None) && this.chkShellExecute.Checked; if (priorityToRedirect) { if (bothChecked) { this.chkShellExecute.Checked = false; } } else { if (bothChecked) { this.RedirectStreams = RedirectStandardStreams.None; // This is necessary because the above line actually sets // multiple check boxes, which can cause this to uncheck. this.chkShellExecute.Checked = true; } } this.lblVerb.Enabled = this.chkShellExecute.Checked; this.edtVerb.Enabled = this.chkShellExecute.Checked; this.chkErrorAsOutput.Enabled = this.chkRedirectError.Checked; }
public override bool OnOk() { bool result = false; if (this.edtCommand.Text.Trim().Length == 0) { WindowsUtility.ShowError(this, "You must enter a command."); } else if (this.numFirstSuccess.Value > this.numLastSuccess.Value) { WindowsUtility.ShowError(this, "The last success code must be greater than or equal to the first success code."); } else if (this.step != null) { this.step.Command = this.edtCommand.Text; this.step.Arguments = this.edtArguments.Text; this.step.WorkingDirectory = this.edtWorkingDirectory.Text; this.step.WindowState = (ProcessWindowStyle)this.cbWindowState.SelectedIndex; this.step.UseShellExecute = this.chkShellExecute.Checked; this.step.Verb = this.edtVerb.Text; this.step.FirstSuccessCode = (int)this.numFirstSuccess.Value; this.step.LastSuccessCode = (int)this.numLastSuccess.Value; this.step.RedirectStreams = this.RedirectStreams; result = true; } return(result); }
public ExecuteCommandArgs( string fileName, string arguments, string workingDirectory, ProcessWindowStyle windowStyle, int firstSuccessCode, int lastSuccessCode, RedirectStandardStreams redirectStreams, bool useShellExecute, string verb) { this.FileName = fileName; this.Arguments = arguments; this.WorkingDirectory = workingDirectory; this.WindowStyle = windowStyle; this.FirstSuccessCode = firstSuccessCode; this.LastSuccessCode = lastSuccessCode; this.RedirectStandardStreams = redirectStreams; this.UseShellExecute = useShellExecute; this.Verb = verb; }