protected override void OnSessionLost(object sender, AllJoynSessionLostEventArgs args) { // Reset everything this.ResetWatcher(ref _audioWatcher, ref _audioBusAttachment, w => { w.Stop(); w.Added -= this.audioWatcher_Added; }); this.ResetConsumer(ref _audioConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.MuteChanged -= this.audioConsumer_MuteChanged; c.VolumeChanged -= this.audioConsumer_VolumeChanged; }); this.ResetWatcher(ref _channelWatcher, ref _channelBusAttachment, w => { w.Stop(); w.Added -= this.channelWatcher_Added; }); this.ResetConsumer(ref _channelConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.ChannelUpDownChanged -= this.channelConsumer_ChannelUpDownChanged; }); this.ResetWatcher(ref _powerSwitchWatcher, ref _powerSwitchBusAttachment, w => { w.Stop(); w.Added -= this.powerSwitchWatcher_Added; }); this.ResetConsumer(ref _powerSwitchConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.ValueChanged -= this.powerSwitchConsumer_ValueChanged; }); }
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 async void Consumer_SessionLost(CharacterLCDConsumer sender, AllJoynSessionLostEventArgs args) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { Status = "Session lost!"; }); }
protected override void OnSessionLost(object sender, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _mcuWatcher, ref _mcuBusAttachment, w => { w.Stop(); w.Added -= this.MCUWatcher_Added; }); this.ResetConsumer(ref _mcuConsumer, c => c.SessionLost -= this.Consumer_SessionLost); this.ResetWatcher(ref _mediaPlayerWatcher, ref _mediaPlayerBusAttachment, w => { w.Stop(); w.Added -= this.MediaPlayerWatcher_Added; }); this.ResetConsumer(ref _mediaPlayerConsumer, c => c.SessionLost -= this.Consumer_SessionLost); }
protected override void OnSessionLost(object consumerObject, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _powerSwitchWatcher, ref _powerSwitchBusAttachment, w => { w.Stop(); w.Added -= this.powerSwitchWatcher_Added; }); this.ResetConsumer(ref _powerSwitchConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; _powerSwitchConsumer.ValueChanged -= this.powerSwitchConsumer_ValueChanged; }); }
protected override void OnSessionLost(object consumer, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _temperatureWatcher, ref _temperatureBusAttachment, w => { w.Stop(); w.Added -= this.temperatureWatcher_Added; }); this.ResetConsumer(ref _temperatureConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.TemperatureChanged -= this.temperatureConsumer_TemperatureChanged; }); }
protected override void OnSessionLost(object consumer, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _engineWatcher, ref _engineBusAttachment, w => { w.Stop(); w.Added -= this.engineWatcher_Added; }); this.ResetConsumer(ref _engineConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.HomeAwayChanged -= this.engineConsumer_HomeAwayChanged; }); }
protected override void OnSessionLost(object consumer, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _openlevelWatcher, ref _openlevelBusAttachment, w => { w.Stop(); w.Added -= this.openlevelWatcher_Added; }); this.ResetConsumer(ref _openlevelConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.OpenLevelChanged -= this.openlevelConsumer_OpenLevelChanged; }); }
protected override void OnSessionLost(object consumer, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _lampStateWatcher, ref _lampStateBusAttachment, w => { w.Stop(); w.Added -= this.LampStateWatcher_Added; }); this.ResetConsumer(ref _lampStateConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.Signals.LampStateChangedReceived -= this.lampStateConsumer_LampStateChangedReceived; }); }
async void OnFezHatLost(FezHatConsumer sender, AllJoynSessionLostEventArgs args) { await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { FezHats.Remove(FezHats.Single(entry => entry.Consumer == sender)); } ); }
protected override void OnSessionLost(object consumer, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _controlPanelWatcher, ref _controlPanelBusAttachment, w => { w.Stop(); w.Added -= this.controlPanelWatcher_Added; }); this.ResetWatcher(ref _propertyWatcher, ref _propertyBusAttachment, w => w.Stop()); this.ResetConsumer(ref _controlPanelConsumer, c => c.SessionLost -= this.Consumer_SessionLost); this.ResetConsumer(ref _powerPropertyConsumer, c => { /* TODO: Unsubscribe from value changed signals */ }); this.ResetConsumer(ref _currentTemperaturePropertyConsumer, c => { /* TODO: Unsubscribe from value changed signals */ }); this.ResetConsumer(ref _targetTemperaturePropertyConsumer, c => { /* TODO: Unsubscribe from value changed signals */ }); this.ResetConsumer(ref _windStrengthPropertyConsumer, c => { /* TODO: Unsubscribe from value changed signals */ }); }
protected void Consumer_SessionLost <T>(T sender, AllJoynSessionLostEventArgs args) { // No longer connected this.IsConnected = false; // Reset everything this.OnSessionLost(sender, args); // Restart this.Start(); }
protected override void OnSessionLost(object consumerObject, AllJoynSessionLostEventArgs args) { this.ResetWatcher(ref _interface1Watcher, ref _interface1BusAttachment, w => { w.Stop(); w.Added -= this.powerinterface_1Watcher_Added; }); this.ResetConsumer(ref _interface1Consumer, c => { c.SessionLost -= this.Consumer_SessionLost; _interface1Consumer.ButtonA0Changed -= this.interface1Consumer_ButtonA0Changed; _interface1Consumer.ButtonAIChanged -= this.interface1Consumer_ButtonAIChanged; _interface1Consumer.ButtonB0Changed -= this.interface1Consumer_ButtonB0Changed; _interface1Consumer.ButtonBIChanged -= this.interface1Consumer_ButtonBIChanged; }); }
private void Consumer_SessionLost(AllJoynSession sender, AllJoynSessionLostEventArgs args) { if (discoveredReceivers.ContainsKey(sender.Id)) { var lostReceiver = discoveredReceivers[sender.Id]; discoveredReceivers.Remove(sender.Id); if (discovered != null) { RCReceiverLost handler = lost; var ignore = CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { handler(this, lostReceiver); }); } } }
protected override void OnSessionLost(object sender, AllJoynSessionLostEventArgs args) { // Reset all watchers and consumers this.ResetWatcher(ref _modeWatcher, ref _modeBusAttachment, w => { w.Stop(); w.Added -= this.modeWatcher_Added; }); this.ResetConsumer(ref _modeConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.ModesChanged -= this.modeConsumer_ModesChanged; c.SupportedModesChanged -= this.modeConsumer_SupportedModesChanged; }); this.ResetWatcher(ref _binaryWatcher, ref _binaryBusAttachment, w => { w.Stop(); w.Added -= this.binaryWatcher_Added; }); this.ResetConsumer(ref _binaryConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.ValueChanged -= this.binaryConsumer_ValueChanged; }); this.ResetWatcher(ref _airflowWatcher, ref _airflowBusAttachment, w => { w.Stop(); w.Added -= this.airflowWatcher_Added; }); this.ResetConsumer(ref _airflowConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.DirectionChanged -= this.airflowConsumer_DirectionChanged; c.RangeChanged -= this.airflowConsumer_RangeChanged; c.SpeedChanged -= this.airflowConsumer_SpeedChanged; }); this.ResetWatcher(ref _temperatureWatcher, ref _temperatureBusAttachment, w => { w.Stop(); w.Added -= this.temperatureWatcher_Added; }); this.ResetConsumer(ref _temperatureConsumer, c => { c.SessionLost -= this.Consumer_SessionLost; c.TemperatureChanged -= this.temperatureConsumer_TemperatureChanged; c.RangeChanged -= this.temperatureConsumer_RangeChanged; c.UnitsChanged -= this.temperatureConsumer_UnitsChanged; }); }
private void AllplayProducer_SessionLost(net.allplay.AllPlayProducer sender, AllJoynSessionLostEventArgs args) { System.Diagnostics.Debug.WriteLine($"IMediaPlayerService.Session Lost: {args.Reason}"); }
private void Consumer_SessionLost(LampConsumer sender, AllJoynSessionLostEventArgs args) { m_Lamps.Remove(sender); }
private void Consumer_SessionLost(OnboardingConsumer sender, AllJoynSessionLostEventArgs args) { UpdateStatusAsync(string.Format("AllJoyn session with the onboardee lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage); DisposeConsumer(); ResetControls(); }
async void OnFezHatLost(FezHatConsumer sender, AllJoynSessionLostEventArgs args) { await Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { FezHats.Remove(FezHats.Single(entry => entry.Consumer == sender)); } ); }
protected abstract void OnSessionLost(object sender, AllJoynSessionLostEventArgs args);
private void Consumer_SessionLost(OnboardingConsumer sender, AllJoynSessionLostEventArgs args) { UpdateStatusAsync(string.Format("AllJoyn session with the onboardee lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage); DisposeConsumer(); ResetControls(); }
private void Consumer_SessionLost(ShadesConsumer sender, AllJoynSessionLostEventArgs args) { m_Shades.Remove(sender); }
private void Consumer_SessionLost(ShadesConsumer sender, AllJoynSessionLostEventArgs args) { SessionLost?.Invoke(this, new EventArgs()); }
private void Consumer_SessionLost(HumidityConsumer sender, AllJoynSessionLostEventArgs args) { if (this.onSensorSessionLost != null) this.onSensorSessionLost.Invoke(this); }
private void Consumer_SessionLost(AllJoynSession sender, AllJoynSessionLostEventArgs args) { UpdateStatusAsync(string.Format("AllJoyn session with the producer lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage); ConsumerOptionsVisibility = Visibility.Collapsed; DisposeConsumer(); }
private void Consumer_SessionLost(SecureInterfaceConsumer sender, AllJoynSessionLostEventArgs args) { UpdateStatusAsync(string.Format("AllJoyn session with the producer lost due to {0}.", args.Reason.ToString()), NotifyType.StatusMessage); ConsumerOptionsVisibility = Visibility.Collapsed; DisposeConsumer(); }
private void OnConsumerSessionLost(LampStateConsumer sender, AllJoynSessionLostEventArgs args) { string id = string.Empty; foreach(var consumer in Consumers) { if(consumer.Value == sender) { id = consumer.Key; } } if(id != string.Empty) { Consumers[id].SessionLost -= OnConsumerSessionLost; Consumers[id] = null; Consumers.Remove(id); } Debug.WriteLine("LampState session lost. ID:" + id); if (NewEventReceived != null) { NewEventReceived(this, "LampState session lost. ID:" + id); } }
private async void Producer_SessionLost(CharacterLCDProducer sender, AllJoynSessionLostEventArgs args) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { Status = "Session lost!"; }); }