Exemple #1
0
 protected virtual async void DispatchToUIThreadProgressReport(string msg, HttpStatusCode status)
 {
     if (OnProgressReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                              new DispatchedHandler(() => { OnProgressReported(msg, status); }));
     }
 }
Exemple #2
0
 protected virtual async void DispatchToUIThreadErrorReport(Exception e)
 {
     if (OnErrorReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                              new DispatchedHandler(() => { OnErrorReported(e); }));
     }
 }
Exemple #3
0
 async void EventChannel_OnProgressReported(string msg, HttpStatusCode status)
 {
     if (OnProgressReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(
             CoreDispatcherPriority.Normal,
             new DispatchedHandler(() => { OnProgressReported(msg, status); }));
     }
 }
Exemple #4
0
 async void EventChannel_OnEventChannelClosed(Windows.Foundation.AsyncStatus status)
 {
     if (OnEventChannelTerminated != null)
     {
         await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                              new DispatchedHandler(() => { OnEventChannelTerminated(status); }));
     }
     if (this.restartEventChannel)
     {
         this.EventChannel.Start();
     }
 }
Exemple #5
0
 async void EventChannel_OnErrorReported(Exception e)
 {
     // connection interrupted.
     // report error and restart the event channel
     if (OnErrorReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(
             CoreDispatcherPriority.Normal,
             new DispatchedHandler(() => { OnErrorReported(e); }));
     }
     // await CleanUp();
     this.restartEventChannel = true;
     //this.EventChannel.Start();
     //this.EventChannel.Restart();
 }
Exemple #6
0
        protected virtual async void DispatchToUIThreadReceivedEventNotifications(UcwaEventsData events)
        {
            if (this.OnEventNotificationsReceived != null)
            {
                await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                                     new DispatchedHandler(() => { this.OnEventNotificationsReceived(events); }));
            }

            //foreach (var sender in eventsData.SenderNames)
            //{
            //    if (OnEventsReceived != null)
            //        await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
            //            new DispatchedHandler(() => { OnEventsReceived(sender, eventsData.GetEventsBySender(sender)); }));
            //}
        }
Exemple #7
0
        async void EventChannel_OnEventNotificationsReceived(UcwaEventsData events)
        {
            UcwaEventsData eventsData = events as UcwaEventsData;

            if (eventsData == null)
            {
                return;
            }
            if (this.OnEventNotificationsReceived != null)
            {
                await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                                     new DispatchedHandler(() => { this.OnEventNotificationsReceived(eventsData); }));
            }

            foreach (var sender in eventsData.SenderNames)
            {
                if (OnEventsReceived != null)
                {
                    await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                                         new DispatchedHandler(() => { OnEventsReceived(sender, eventsData.GetEventsBySender(sender)); }));
                }
            }
        }