Example #1
0
 protected virtual async void DispatchToUIThreadProgressReport(string msg, HttpStatusCode status)
 {
     if (OnProgressReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                              new DispatchedHandler(() => { OnProgressReported(msg, status); }));
     }
 }
Example #2
0
 protected virtual async void DispatchToUIThreadErrorReport(Exception e)
 {
     if (OnErrorReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(CoreDispatcherPriority.Normal,
                                              new DispatchedHandler(() => { OnErrorReported(e); }));
     }
 }
Example #3
0
 async void EventChannel_OnProgressReported(string msg, HttpStatusCode status)
 {
     if (OnProgressReported != null)
     {
         await UcwaAppUtils.DispatchEventToUI(
             CoreDispatcherPriority.Normal,
             new DispatchedHandler(() => { OnProgressReported(msg, status); }));
     }
 }
Example #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();
     }
 }
Example #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();
 }
Example #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)); }));
            //}
        }
Example #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)); }));
                }
            }
        }