Exemplo n.º 1
0
        public static string GetText(NotificationsSubMode submode, int unreadEntries)
        {
            switch (submode)
            {
            case NotificationsSubMode.Alerts:
                return(unreadEntries == 0
                               ? Messages.NOTIFICATIONS_SUBMODE_ALERTS_READ
                               : string.Format(Messages.NOTIFICATIONS_SUBMODE_ALERTS_UNREAD, unreadEntries));

            case NotificationsSubMode.Updates:
                return(unreadEntries == 0
                               ? Messages.NOTIFICATIONS_SUBMODE_UPDATES_READ
                               : string.Format(Messages.NOTIFICATIONS_SUBMODE_UPDATES_UNREAD, unreadEntries));

            case NotificationsSubMode.Events:
                if (unreadEntries == 0)
                {
                    return(Messages.NOTIFICATIONS_SUBMODE_EVENTS_READ);
                }
                else if (unreadEntries == 1)
                {
                    return(Messages.NOTIFICATIONS_SUBMODE_EVENTS_UNREAD_ONE);
                }
                else
                {
                    return(string.Format(Messages.NOTIFICATIONS_SUBMODE_EVENTS_UNREAD_MANY, unreadEntries));
                }

            default:
                return("");
            }
        }
Exemplo n.º 2
0
        private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem)
        {
            lastNotificationsMode = subModeItem.SubMode;

            if (NotificationsSubModeChanged != null)
            {
                NotificationsSubModeChanged(subModeItem);
            }
        }
Exemplo n.º 3
0
        public void SwitchToNotificationsView(NotificationsSubMode subMode)
        {
            //check the button if switching has been requested programmatically
            if (!buttonNotifyBig.Checked)
            {
                buttonNotifyBig.Checked = true;
            }

            //show the notificationsView first and then hide the navigationView
            //to avoid instantaneous appearance of empty panels
            notificationsView.Visible = true;
            notificationsView.SelectNotificationsSubMode(subMode);
            navigationView.Visible = false;
        }
Exemplo n.º 4
0
        public void UpdateEntries(NotificationsSubMode subMode, int entries)
        {
            foreach (var item in Items)
            {
                var subModeItem = item as NotificationsSubModeItem;

                if (subModeItem != null && subModeItem.SubMode == subMode)
                {
                    subModeItem.UnreadEntries = entries;
                    break;
                }
            }

            Invalidate();
        }
Exemplo n.º 5
0
        public void UpdateEntries(NotificationsSubMode subMode, int entries)
        {
            foreach (var item in Items)
            {
                var subModeItem = item as NotificationsSubModeItem;

                if (subModeItem != null && subModeItem.SubMode == subMode)
                {
                    subModeItem.UnreadEntries = entries;
                    break;
                }
            }

            Invalidate();
        }
Exemplo n.º 6
0
        public void SelectNotificationsSubMode(NotificationsSubMode subMode)
        {
            foreach (var item in Items)
            {
                var subModeItem = item as NotificationsSubModeItem;
               
                if (subModeItem != null && subModeItem.SubMode == subMode)
                {
                    var lastSelected = SelectedItem;
                    SelectedItem = item;

                    if (lastSelected == SelectedItem)
                        OnSelectedIndexChanged(EventArgs.Empty);
                    
                    break;
                }
            }
        }
Exemplo n.º 7
0
        public static Image GetImage(NotificationsSubMode submode, int unreadEntries)
        {
            switch (submode)
            {
            case NotificationsSubMode.Alerts:
                return(Properties.Resources._000_Alert2_h32bit_16);

            case NotificationsSubMode.Updates:
                return(Properties.Resources.notif_updates_16);

            case NotificationsSubMode.Events:
                return(unreadEntries == 0
                               ? Properties.Resources.notif_events_16
                               : Properties.Resources.notif_events_errors_16);

            default:
                return(null);
            }
        }
Exemplo n.º 8
0
        public void SelectNotificationsSubMode(NotificationsSubMode subMode)
        {
            foreach (var item in Items)
            {
                var subModeItem = item as NotificationsSubModeItem;

                if (subModeItem != null && subModeItem.SubMode == subMode)
                {
                    var lastSelected = SelectedItem;
                    SelectedItem = item;

                    if (lastSelected == SelectedItem)
                    {
                        OnSelectedIndexChanged(EventArgs.Empty);
                    }

                    break;
                }
            }
        }
Exemplo n.º 9
0
 public NotificationsSubModeItem(NotificationsSubMode submode)
 {
     SubMode = submode;
 }
Exemplo n.º 10
0
        private void SwitchToNotificationsView(NotificationsSubMode subMode)
        {
            //check the button if switching has been requested programmatically
            if (!buttonNotifyBig.Checked)
                buttonNotifyBig.Checked = true;

            //show the notificationsView first and then hide the navigationView
            //to avoid instantaneous appearance of empty panels
            notificationsView.Visible = true;
            notificationsView.SelectNotificationsSubMode(subMode);
            navigationView.Visible = false;
        }
Exemplo n.º 11
0
        private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem)
        {
            lastNotificationsMode = subModeItem.SubMode;

            if (NotificationsSubModeChanged != null)
                NotificationsSubModeChanged(subModeItem);
        }
Exemplo n.º 12
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.UnreadEntries = buttonNotifySmall.UnreadEntries = notificationsView.GetTotalEntries();
 }
Exemplo n.º 13
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.UnreadEntries = buttonNotifySmall.UnreadEntries = notificationsView.GetTotalEntries();
 }
Exemplo n.º 14
0
 public NotificationsSubModeItem(NotificationsSubMode submode)
 {
     SubMode = submode;
 }
Exemplo n.º 15
0
 public static string GetText(NotificationsSubMode submode, int unreadEntries)
 {
     switch (submode)
     {
         case NotificationsSubMode.Alerts:
             return unreadEntries == 0
                        ? Messages.NOTIFICATIONS_SUBMODE_ALERTS_READ
                        : string.Format(Messages.NOTIFICATIONS_SUBMODE_ALERTS_UNREAD, unreadEntries);
         case NotificationsSubMode.Updates:
             return unreadEntries == 0
                        ? Messages.NOTIFICATIONS_SUBMODE_UPDATES_READ
                        : string.Format(Messages.NOTIFICATIONS_SUBMODE_UPDATES_UNREAD, unreadEntries);
         case NotificationsSubMode.Events:
             if (unreadEntries == 0)
                 return Messages.NOTIFICATIONS_SUBMODE_EVENTS_READ;
             else if (unreadEntries == 1)
                 return Messages.NOTIFICATIONS_SUBMODE_EVENTS_UNREAD_ONE;
             else
                 return string.Format(Messages.NOTIFICATIONS_SUBMODE_EVENTS_UNREAD_MANY, unreadEntries);
         default:
             return "";
     }
 }
Exemplo n.º 16
0
 public static Image GetImage(NotificationsSubMode submode, int unreadEntries)
 {
     switch (submode)
     {
         case NotificationsSubMode.Alerts:
             return Properties.Resources._000_Alert2_h32bit_16;
         case NotificationsSubMode.Updates:
             return Properties.Resources.tempUpdates;
         case NotificationsSubMode.Events:
             return unreadEntries == 0
                        ? Properties.Resources._000_date_h32bit_16
                        : Properties.Resources.tempErrorEvents;
         default:
             return null;
     }
 }
Exemplo n.º 17
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.Text = buttonNotifySmall.Text = string.Format("Notifications ({0})", notificationsView.GetTotalEntries());
 }