Exemple #1
0
        public void UpdateWarnings(WorkTime workTime)
        {
            if (workTime.WarningTimeReached()) {
                gbTimes.Background = new SolidColorBrush(_config.WarnBackgroundColor);
                tbMaxTimeRemaining.Background = new SolidColorBrush(_config.WarnBackgroundColor);
            }
            else {
                gbTimes.Background = _defaultBackground;
                tbMaxTimeRemaining.Background = new SolidColorBrush(_config.OkBackgroundColor);
            }

            tbTimeTargetRemaining.Background = workTime.IsLessThanTargetTime()
                                                   ? new SolidColorBrush(_config.WarnBackgroundColor)
                                                   : new SolidColorBrush(_config.OkBackgroundColor);

            tbMinTimeRemaining.Background = workTime.IsLessThanMinTime()
                                                ? new SolidColorBrush(_config.WarnBackgroundColor)
                                                : new SolidColorBrush(_config.OkBackgroundColor);
        }
Exemple #2
0
        private void UpdateWarnings(WorkTime workTime)
        {
            ucTimeAsText.UpdateWarnings(workTime);

            //  TODO SOMETHING REALLY FLASHY HERE

            var showFlashyWarning = workTime.TargetTimePassed() &&
                                    workTime.WarningTimeReached() &&
                                    !_warningCancelled &&
                                    LastWarningIntervalExpired();

            if (showFlashyWarning) {
                ShowWarningMsgBox(workTime);
            }
        }