// Private methods. /// <summary> /// Sets the current result. /// </summary> /// <param name="result">The result.</param> private void OnSetResult(PlManagerHistorySubcommand result) { // Else, if the result is not null. if (null != result) { this.pictureBox.Image = result.Exception == null ? result.ExitStatus == 0 ? Resources.ScriptSuccess_48 : Resources.ScriptWarning_48 : Resources.ScriptError_48; this.textBoxCommand.Text = result.Command; this.textBoxDuration.Text = result.Duration.ToString(); this.textBoxExitStatus.Text = result.ExitStatus.ToString(); this.textBoxException.Text = result.Exception != null ? result.Exception : "(none)"; this.textBoxError.Text = result.Error; this.textBoxResult.Text = result.Result; this.textBoxRetries.Text = result.Retries.ToString(); this.textBoxTimeout.Text = result.Timeout.Ticks >= 0 ? result.Timeout.ToString() : "(infinite)"; } else { this.pictureBox.Image = Resources.Question_48; this.textBoxCommand.Clear(); this.textBoxDuration.Clear(); this.textBoxExitStatus.Clear(); this.textBoxException.Clear(); this.textBoxError.Clear(); this.textBoxResult.Clear(); this.textBoxRetries.Clear(); this.textBoxTimeout.Clear(); } }
// Public methods. /// <summary> /// Clears the result information. /// </summary> public void Clear() { this.Result = null; }