public void EnqueueItem(INotificationItem notificationItem, DateTime earliestSend) { lock (_queue) { _queue.Enqueue(earliestSend, notificationItem); } }
public void EnqueueItem(INotificationItem notificationItem) { lock(_queue) { _queue.Enqueue(DateTime.Now, notificationItem); } }
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; }
private void HandleNotification(INotificationItem notification) { string clientUniqueId = notification.ClientUniqueId; string subscriptionUri = GetSubscriptionUri(clientUniqueId); var response = _notificationAgent.SendNotification(subscriptionUri, notification); HandleResponse(response); }
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(); }
public void Add(INotificationItem notificationItem) { if (notificationItem != null) _notificationItems.Add(notificationItem); }