Esempio n. 1
0
        private void RcConsumer_SessionLost(AllJoynSession sender, AllJoynSessionLostEventArgs args)
        {
            ReceiverLostHandler handler = LostEvent;

            if (handler != null)
            {
                ReceiverLostReason reason = ReceiverLostReason.Unknown;
                switch (args.Reason)
                {
                case AllJoynSessionLostReason.LinkTimeout:
                    reason = ReceiverLostReason.Timeout;
                    break;

                case AllJoynSessionLostReason.RemovedByProducer:
                    reason = ReceiverLostReason.Removed;
                    break;

                case AllJoynSessionLostReason.ProducerLeftSession:
                    reason = ReceiverLostReason.Shutdown;
                    break;

                default:
                    reason = ReceiverLostReason.Unknown;
                    break;
                }
                var ignore = CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    handler(this, reason);
                });
            }
        }
 private void Receiver_LostEvent(object sender, ReceiverLostReason reason)
 {
     this.Frame.GoBack();
 }