Exemplo n.º 1
0
 void FarmRefreshed(FarmRefreshedEventArgs args)
 {
     if (args == null)
     {
         dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(() => {
             Repositories?.Repositories?.ForEach(x => x.RefreshFarm());
             Messenger.Default.Send(new Message(MessageType.RefreshFarm));
         }));
         return;
     }
     if (args.RefreshType == FarmRefreshType.notification)
     {
         dispatcher.BeginInvoke(() => {
             var notification = (NotificationReceivedEventArgs)args;
             try {
                 notification.Parse();
             }
             catch (Exception ex) {
                 Log.Error("Can`t convert message from base64 string", ex);
                 return;
             }
             if (!notification.IsServiceUser)
             {
                 return;
             }
             ProcessNotification(notification.Message);
         });
     }
 }
Exemplo n.º 2
0
 void FarmRefreshed(FarmRefreshedEventArgs args) {
     if (args == null) {
         dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, new Action(() => {
             Repositories?.Repositories?.ForEach(x => x.RefreshFarm());
             Messenger.Default.Send(new Message(MessageType.RefreshFarm));
         }));
         return;
     }
     if (args.RefreshType == FarmRefreshType.notification) {
         dispatcher.BeginInvoke(() => {
             var notification = (NotificationReceivedEventArgs)args;
             try {
                 notification.Parse();
             }
             catch (Exception ex) {
                 Log.Error("Can`t convert message from base64 string", ex);
                 return;
             }
             if (!notification.IsServiceUser)
                 return;
             ProcessNotification(notification.Message);
         });
     }
 }