private void StartWatcher() { AllJoynBusAttachment toasterBusAttachment = new AllJoynBusAttachment(); ToasterWatcher toasterWatcher = new ToasterWatcher(toasterBusAttachment); toasterWatcher.Added += ToasterWatcher_Added; toasterWatcher.Start(); }
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 { } }