Exemple #1
0
 private static void QUEUE(Notification notification)
 {
     if (notification == null)
     {
         if (NotificationsQueue.Count > 0)
         {
             CurrentNotification = NotificationsQueue[0];
             NotificationsQueue.RemoveAt(0);
             PopUpWindow();
         }
         else
         {
             return;
         }
     }
     else
     {
         NotificationsQueue.Add(notification);
         if (NotificationsQueue.Count > 0 && !IsShowing)
         {
             CurrentNotification = NotificationsQueue[0];
             NotificationsQueue.RemoveAt(0);
             PopUpWindow();
         }
         else
         {
             return;
         }
     }
 }
Exemple #2
0
        private void notificationIcon_BalloonTipClosed(object sender, EventArgs e)
        {
            Debug.Assert(NotificationsQueue.Count != 0);

            if (NotificationsQueue[0].Source != null)
            {
                NotificationsQueue[0].Source.Closed(sender, e);
            }
            NotificationsQueue.RemoveAt(0);

            if (NotificationsQueue.Count > 0)
            {
                ShowNextNotification();
            }
        }
Exemple #3
0
 public EmbeddedIdentityProxy(
     UserManager <EmbeddedIdentityServerUser> userManager,
     IClientProxy clientProxy,
     IEmailSender emailSender,
     NotificationsQueue notificationsQueue,
     IHttpContextAccessor httpContextAccessor,
     LinkGenerator linkGenerator)
 {
     _userManager        = userManager;
     _clientProxy        = clientProxy;
     _emailSender        = emailSender;
     _notificationsQueue = notificationsQueue;
     _httpAccessor       = httpContextAccessor;
     _linkGenerator      = linkGenerator;
 }
Exemple #4
0
        /// <summary>
        /// Diplays the given title, message and icon as a system notification area balloon.
        /// </summary>
        /// <param name="title">The title of the balloon.</param>
        /// <param name="message">The message to display.</param>
        /// <param name="icon">The icon to show.</param>
        public void ShowNotificationBalloon(string title, string message, ToolTipIcon icon)
        {
            NotificationInfo info;

            info.Source  = null;
            info.Timeout = 0;
            info.Icon    = icon;
            info.Title   = title;
            info.Message = message;

            NotificationsQueue.Add(info);

            //Can we show the notification immediately?
            if (NotificationsQueue.Count == 1)
            {
                ShowNextNotification();
            }
        }
Exemple #5
0
        public void ShowNotification(INotifier source, int timeout, ToolTipIcon icon,
                                     string title, string message)
        {
            NotificationInfo info;

            info.Source  = source;
            info.Timeout = timeout;
            info.Icon    = icon;
            info.Title   = title;
            info.Message = message;

            NotificationsQueue.Add(info);

            //Can we show the notification immediately?
            if (NotificationsQueue.Count == 1)
            {
                ShowNextNotification();
            }
        }