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(""); } }
private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem) { lastNotificationsMode = subModeItem.SubMode; if (NotificationsSubModeChanged != null) { NotificationsSubModeChanged(subModeItem); } }
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; }
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 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; }
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; }
private void notificationsView_NotificationsSubModeChanged(NotificationsSubModeItem subModeItem) { lastNotificationsMode = subModeItem.SubMode; if (NotificationsSubModeChanged != null) NotificationsSubModeChanged(subModeItem); }
public void UpdateNotificationsButton(NotificationsSubMode mode, int entries) { notificationsView.UpdateEntries(mode, entries); buttonNotifyBig.UnreadEntries = buttonNotifySmall.UnreadEntries = notificationsView.GetTotalEntries(); }
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 ""; } }
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; } }
public void UpdateNotificationsButton(NotificationsSubMode mode, int entries) { notificationsView.UpdateEntries(mode, entries); buttonNotifyBig.Text = buttonNotifySmall.Text = string.Format("Notifications ({0})", notificationsView.GetTotalEntries()); }