private void OnTimerChanged(TimerChangedMessage message) { if (message.TimerIsRunning) { TextColor = GreenYellowRedSelector.GetBrushForTimeRemaining(message.RemainingSecs); TimeString = TimeFormatter.FormatTimerDisplayString(message.CountUp ? message.ElapsedSecs : message.RemainingSecs); // if duration of talk is greater than 1hr we only start showing the sector // when remaining time is less than 1 hr (for sake of clarity)... InitOverallDurationSector(message.RemainingSecs); if (DurationSector != null) { DateTime now = DateTime.Now; var currentAngle = CalcAngleFromTime(now); if (Math.Abs(currentAngle - DurationSector.CurrentAngle) > 0.15) // prevent gratuitous updates { var d = DurationSector.Clone(); d.CurrentAngle = currentAngle; d.IsOvertime = message.RemainingSecs < 0; DurationSector = d; } } } }
private void OnTimerStarted(TimerStartMessage msg) { var model = (TimerOutputWindowViewModel)DataContext; if (!model.SplitAndFullScrenModeIdentical()) { model.TextColor = GreenYellowRedSelector.GetGreenBrush(); // only animate if the user has configured different display // layout for timer mode and full-screen mode DisplaySplitScreen(); } }