Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 private void InitMaxTime(WorkTime workTime, double radius)
 {
     _maxTimeArc = InitArc(maxTimePath, maxTimeStartOnCircle, maxTimeArc, workTime.TargetTime, workTime.MaxTime, radius, false, _config.MaxTimeColor);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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;
 }