private void StartCounting(StartCountingReasons reason, DateTime?start = null) { if (StartCountingRequested == null) { return; } if (this.workReports.Count == 0) { return; } var args = new StartCountingEventArgs(reason); StartCountingRequested(this, args); if (!args.Handled) { return; } if (!args.Continue) { return; } // Counting already started -> do not continue if (this.IsRunning) { return; } // Use start time from parameter or continue right after the last work report var startTime = start.HasValue ? start.Value : this.workReports[this.workReports.Count - 1].ToTime; this.StartCounting(startTime); }
/// <summary> /// Default constructor /// </summary> public StartCountingEventArgs(StartCountingReasons reason) { this.Reason = reason; }