internal void RefreshDuration() { TodayDuration = _clock.GetDuration(DurationModes.Today); TotalDuration = _clock.GetDuration(DurationModes.All); clockLBL.Text = TimeLogManager.formatDuration(TodayDuration); totalLBL.Text = string.Format("Total {0}", TimeLogManager.formatDuration(TotalDuration)); }
private void timer1_Tick(object sender, EventArgs e) { TotalDuration = new TimeSpan(0); TodayDuration = new TimeSpan(0); foreach (ClockUCtrl clock in _clocks.Values) { clock.RefreshDuration(); TotalDuration += clock.TotalDuration; TodayDuration += clock.TodayDuration; totalLBL.Text = string.Format("Total {0} | Today {1}", TimeLogManager.formatDuration(TotalDuration), TimeLogManager.formatDuration(TodayDuration)); } }