Exemple #1
0
        protected void OnCurrentNotificationRecieved(JsonObject notification)
        {
            if (!GowNotification.IsValid(notification))
            {
                LogUtils.LogWarning("Not valid json : " + (notification == null ? "<NULL>" : GOWMiniJSON.Serialize(notification)));
                return;
            }

            if (CurrentNotificationRecieved != null)
            {
                CurrentNotificationRecieved(new GowNotification(notification));
            }
        }
Exemple #2
0
 protected void OnNotificationsRecieved(JsonObject[] notifications)
 {
     if (NotificationRecieved != null)
     {
         NotificationRecieved(notifications.Select(json => {
             if (!GowNotification.IsValid(json))
             {
                 LogUtils.LogWarning("Not valid json : " + json == null ? "<NULL>" : GOWMiniJSON.Serialize(json));
                 return(null);
             }
             return(new GowNotification(json));
         }).SelectNotNull().ToArray());
     }
 }