protected virtual void OnToasterFound(ToasterFoundEventArgs args) { ToasterFoundEventHandler handler = ToasterFound; if (handler != null) { handler(this, args); } }
private async void ToasterWatcher_Added(ToasterWatcher sender, AllJoynServiceInfo args) { ToasterJoinSessionResult toasterJoinSessionResult = await ToasterConsumer.JoinSessionAsync(args, sender); if (toasterJoinSessionResult.Status == AllJoynStatus.Ok) { ToasterFoundEventArgs toasterFoundArgs = new ToasterFoundEventArgs(toasterJoinSessionResult.Consumer); OnToasterFound(toasterFoundArgs); } else { } }
private async void ToasterFinder_ToasterFound(object sender, ToasterFoundEventArgs args) { toasterClient = new ToasterClient(args.Consumer); toasterClient.Consumer.DarknessLevelChanged += Consumer_DarknessLevelChanged; toasterClient.Consumer.Signals.ToastBurntReceived += Signals_ToastBurntReceived; string versionText = toasterClient.ToasterVersion.ToString(); await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { EnableUI(versionText); }); UpdateSliderValue(); }