コード例 #1
0
 public void EnqueueItem(INotificationItem notificationItem, DateTime earliestSend)
 {
     lock (_queue)
     {
         _queue.Enqueue(earliestSend, notificationItem);
     }
 }
コード例 #2
0
 public void EnqueueItem(INotificationItem notificationItem)
 {
     lock(_queue)
     {
         _queue.Enqueue(DateTime.Now, notificationItem);
     }
 }
コード例 #3
0
ファイル: NotificationAgent.cs プロジェクト: andlju/entile
        public NotificationResponse SendNotification(string channelUri, INotificationItem notification)
        {
            NotificationResponse response;
            var tileNotification = notification as TileNotification;
            if (tileNotification != null)
            {
                response = SendTileNotification(channelUri, tileNotification);
                response.NotificationItem = notification;
                return response;
            }

            var toastNotification = notification as ToastNotification;
            if (toastNotification != null)
            {
                response = SendToastNotification(channelUri, toastNotification);
                response.NotificationItem = notification;
                return response;
            }

            var rawNotification = notification as RawNotification;
            if (rawNotification != null)
            {
                response = SendRawNotification(channelUri, rawNotification.Body);
                response.NotificationItem = notification;
                return response;
            }

            return null;
        }
コード例 #4
0
ファイル: Notifier.cs プロジェクト: andlju/entile
        private void HandleNotification(INotificationItem notification)
        {
            string clientUniqueId = notification.ClientUniqueId;
            string subscriptionUri = GetSubscriptionUri(clientUniqueId);

            var response = _notificationAgent.SendNotification(subscriptionUri, notification);

            HandleResponse(response);
        }
コード例 #5
0
        public void PushNotification(INotificationItem notification)
        {
            notificationItemsControl.Items.Insert(0, notification);

            var timer = new DispatcherTimer {
                Interval = Timeout
            };
            EventHandler timerCallback = null;

            timerCallback = (s, e) =>
            {
                timer.Stop();
                timer.Tick -= timerCallback;
                notificationItemsControl.Items.Remove(notification);
            };
            timer.Tick += timerCallback;
            timer.Start();
        }
コード例 #6
0
ファイル: Notification.cs プロジェクト: AChehre/Paran
 public void Add(INotificationItem notificationItem)
 {
     if (notificationItem != null)
         _notificationItems.Add(notificationItem);
 }