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("");
            }
        }
示例#2
0
        private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem)
        {
            lastNotificationsMode = subModeItem.SubMode;

            if (NotificationsSubModeChanged != null)
            {
                NotificationsSubModeChanged(subModeItem);
            }
        }
示例#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;
        }
示例#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();
        }
        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();
        }
示例#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;
                }
            }
        }
        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);
            }
        }
        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;
                }
            }
        }
 public NotificationsSubModeItem(NotificationsSubMode submode)
 {
     SubMode = submode;
 }
示例#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;
        }
示例#11
0
        private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem)
        {
            lastNotificationsMode = subModeItem.SubMode;

            if (NotificationsSubModeChanged != null)
                NotificationsSubModeChanged(subModeItem);
        }
示例#12
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.UnreadEntries = buttonNotifySmall.UnreadEntries = notificationsView.GetTotalEntries();
 }
示例#13
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.UnreadEntries = buttonNotifySmall.UnreadEntries = notificationsView.GetTotalEntries();
 }
示例#14
0
 public NotificationsSubModeItem(NotificationsSubMode submode)
 {
     SubMode = submode;
 }
示例#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 "";
     }
 }
示例#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;
     }
 }
示例#17
0
 public void UpdateNotificationsButton(NotificationsSubMode mode, int entries)
 {
     notificationsView.UpdateEntries(mode, entries);
     buttonNotifyBig.Text = buttonNotifySmall.Text = string.Format("Notifications ({0})", notificationsView.GetTotalEntries());
 }