Пример #1
0
        public void StartTimer()
        {
            // Check if the last time period is still running. If so do nothing.
            TimePeriod lastPeriod = TimePeriods.LastOrDefault();

            if (lastPeriod != null && !lastPeriod.EndTime.HasValue)
            {
                return;
            }

            // Otherwise add a new timing period.
            TimePeriods.Add(new TimePeriod {
                StartTime = DateTime.Now
            });
        }