public TryGetEndTime ( System.DateTime startTime, System.DateTime &endTime ) : bool | ||
startTime | System.DateTime | The time the timer is started. |
endTime | System.DateTime | The end time for a timer started with this |
return | bool |
/// <summary> /// Starts the timer. /// </summary> /// <param name="newTimerStart">A <see cref="TimerStart"/>.</param> /// <returns>A value indicating whether the timer was started successfully.</returns> /// <exception cref="ObjectDisposedException">If the timer has been disposed.</exception> public bool Start(TimerStart newTimerStart) { this.ThrowIfDisposed(); DateTime start = DateTime.Now; DateTime end; if (newTimerStart != null && newTimerStart.TryGetEndTime(start, out end)) { this.timerStart = newTimerStart; this.OnPropertyChanged("TimerStart"); this.Start(start, end); return(true); } return(false); }
/// <summary> /// Starts the timer. /// </summary> /// <param name="newTimerStart">A <see cref="TimerStart"/>.</param> /// <returns>A value indicating whether the timer was started successfully.</returns> /// <exception cref="ObjectDisposedException">If the timer has been disposed.</exception> public bool Start(TimerStart newTimerStart) { this.ThrowIfDisposed(); DateTime start = DateTime.Now; DateTime end; if (newTimerStart != null && newTimerStart.TryGetEndTime(start, out end)) { this.timerStart = newTimerStart; this.OnPropertyChanged("TimerStart"); this.Start(start, end); return true; } return false; }