public void handleMessage(Message message)
        {
            Element msg = message.AsElement;

            // Extract originalId_value from IOI message. For NEW, original and id_value will
            // be the same. For REPLACE or CANCEL, these values differ.

            String original = msg.GetElementAsString("originalId_value");
            String change   = msg.GetElementAsString("change");

            IOI ioi = null;

            ioi = this.Get(original);

            if (ioi == null)
            {
                // unknown incoming IOI. Create the ioi object and set the id from id_value
                ioi = new IOI(this, original);
                iois.Add(ioi);
            }

            ioi.populateFields(msg);

            Notification.NotificationType nt = Notification.NotificationType.NEW;
            if (change == "REPLACE")
            {
                nt = Notification.NotificationType.REPLACE;
            }
            else if (change == "CANCEL")
            {
                nt = Notification.NotificationType.CANCEL;
            }

            this.notify(ioi, nt);
        }
 internal void notify(IOI ioi, Notification.NotificationType nt)
 {
     foreach (NotificationHandler nh in this.notificationHandlers)
     {
         nh.ProcessNotification(new Notification(Notification.NotificationCategory.IOIDATA, nt, ioi));
     }
 }
        private Template GetTempFromPharmacy(Notification.NotificationType type)
        {
            Template temp = null;

            pharmacy.GetTemplates();
            switch (type)
            {
            case Notification.NotificationType.Refill:
                temp = pharmacy.GetRefillTemplate();
                break;

            case Notification.NotificationType.Recall:
                temp = pharmacy.GetRecallTemplate();
                break;

            case Notification.NotificationType.Ready:
                temp = pharmacy.GetReadyTemplate();
                break;

            case Notification.NotificationType.Birthday:
                temp = pharmacy.GetBirthdayTemplate();
                break;
            }
            return(temp);
        }
Beispiel #4
0
 //Adds a notification to the end of the list
 public void addNotification(string text, Actor actor, Movie movie, bool passed, Notification.NotificationType notiType)
 {
     notificationList.Add(new Notification(text, actor, movie, passed, notiType));
     notificationBanner.setText(notificationList.Count.ToString());
     notificationBanner.showNotification();
     UpdateNotificationsUI();
 }
Beispiel #5
0
 public void addMessage(string msg, Notification.NotificationType type, int requestId)
 {
     lock (notificationLock)
     {
         notifications.Add(new Notification(msg, type, requestId));
     }
     notifyAllObservers();
 }
Beispiel #6
0
 public static BaseNotificationConfig GetConfig(Notification.NotificationType type)
 {
     return(GetConfig(type.ToString()));
 }