/// <summary> /// Invoked when the <see cref="StartCommand"/> is executed. /// </summary> /// <param name="sender">The <see cref="TimerWindow"/>.</param> /// <param name="e">The event data.</param> private void StartCommandExecuted(object sender, ExecutedRoutedEventArgs e) { TimerStart timerStart = TimerStart.FromString(timerValue); if (timerStart == null) { //this.BeginValidationErrorAnimation(); return; } // If the interface was previously locked, unlock it when a new timer is started this.Options.LockInterface = false; this.Show(timerStart); //this.StartButton.Unfocus(); }
/// <summary> /// Returns the <see cref="TimerStart"/> value corresponding to the concatenation of all <paramref /// name="remainingArgs"/>, or throws an exception if the concatenation of all <paramref name="remainingArgs"/> /// is not a valid representation of a <see cref="TimerStart"/>. /// </summary> /// <param name="remainingArgs">The unparsed arguments.</param> /// <returns>The <see cref="TimerStart"/> value corresponding to the concatenation of all <paramref /// name="remainingArgs"/></returns> /// <exception cref="ParseException">If the concatenation of all <paramref name="remainingArgs"/> is not a /// valid representation of a <see cref="TimerStart"/>.</exception> private static TimerStart GetTimerStartValue(IEnumerable <string> remainingArgs) { string value = string.Join(" ", remainingArgs); TimerStart timerStart = TimerStart.FromString(value); if (timerStart == null) { string message = string.Format( Resources.ResourceManager.GetEffectiveProvider(), Resources.CommandLineArgumentsParseExceptionInvalidTimerInputFormatString, value); throw new ParseException(message); } return(timerStart); }