public void Update(WorkTime workTime, bool isChecked) { _timeSpentArc = new Arc(timeSpentPath, timeSpentStartOnCircle, timeSpentArc, _zeroPos, _config.TimeSpentColor); _timeSpentArc.Update(workTime.StartTime, DateTime.Now, RadiusTimeSpent, workTime.TimeSpent > _config.MinTimeSpan); _timeSpentArc.Visibility = isChecked; lbClockTop.Content = "time spent: " + workTime.TimeSpent.ToDisplayString(); lbClockBottom.Content = "remaining: " + workTime.RemainingTillTarget.ToDisplayString(); if (workTime.StartTime != _startTime) { Init(workTime, _config); } }
private void InitTargetTime(WorkTime workTime, double radius) { var rect = new Rect(TargetTimeRotation, rectangleTargetTime); rect.Update(workTime.TargetTime); rect.Visibility = false; _targetTimeArc = InitArc(targetTimePath, targetTimeStartOnCircle, targetTimeArc, workTime.StartTime, workTime.TargetTime, radius, true, _config.TargetTimeColor); }
private void InitMaxTime(WorkTime workTime, double radius) { _maxTimeArc = InitArc(maxTimePath, maxTimeStartOnCircle, maxTimeArc, workTime.TargetTime, workTime.MaxTime, radius, false, _config.MaxTimeColor); }
private void InitMinTime(WorkTime workTime, double radius) { var isLargeArc = workTime.MinTimeEnd.Subtract(workTime.MinTimeStart) > _config.MinTimeSpan; _minTimeArc = InitArc(minTimePath, minTimeStartOnCircle, minTimeArcSegment, workTime.MinTimeStart, workTime.MinTimeEnd, radius, isLargeArc, _config.MinTimeColor); }
private Arc InitArc(Path path, LineSegment lineSegment, ArcSegment arcSegment, DateTime startTime, DateTime endTime, double radius, bool isLargeArc, Color color) { var arc = new Arc(path, lineSegment, arcSegment, _zeroPos, color); arc.Update(startTime, endTime, radius, isLargeArc); return arc; }