Пример #1
0
        private void RefreshNotifyIcon()
        {
            if (_presenceControlEntries.Count == 0)
            {
                return;
            }
            var leftTimeSpan  = new TimeSpan(0, Convert.ToInt32(_leftMins), 0);
            var colorIconText = Color.Green;

            if (leftTimeSpan.TotalHours >= 1)
            {
                _notifyIcon.Icon = Icons.CreateTextIcon(((int)leftTimeSpan.TotalHours).ToString() + "h", Color.Red);
            }
            else
            {
                _notifyIcon.Icon = Icons.CreateTextIcon(leftTimeSpan.TotalMinutes.ToString(), Color.Green);
            }
            _notifyIcon.Text = String.Format("Tiempo restante {0}", leftTimeSpan.ToString(@"hh\:mm"));
            if (leftTimeSpan.TotalMinutes < 1)
            {
                _notificationService.Show("Ha terminado tu jornada laboral.", "Control de presencia", Enums.NotificationTypeEnum.Info);
            }
        }