private async void RemoteSystemWatcher_RemoteSystemUpdated(RemoteSystemWatcher sender, RemoteSystemUpdatedEventArgs args) { var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystem.Id).FirstOrDefault(); if (remoteSystem != null) { return; } var existingSystem = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystem.Id).FirstOrDefault(); if (existingSystem == null) { var system = await AdventureRemoteSystem.CreateAdventureRemoteSystem(args.RemoteSystem).ConfigureAwait(false); if (system != null) { var t = Helpers.RunOnCoreDispatcherIfPossible(() => { if (_availableRemoteSystems.Where(s => s.RemoteSystem.Id == system.RemoteSystem.Id).Count() == 0) { _availableRemoteSystems.Add(system); RemoteSystemAdded?.Invoke(this, system); } }); } } }
internal void InvokeRemoteSystemAdded(RemoteSystem remoteSystem) { RemoteSystemAdded?.Invoke(this, new RemoteSystemAddedEventArgs(remoteSystem)); }
private void RemoteSystemWatcher_RemoteSystemAdded(RemoteSystemWatcher watcher, RemoteSystemAddedEventArgs args) { System.Diagnostics.Debug.WriteLine($"KNOWZY: RemoteSystemAdded: {args.P0.DisplayName} + ({args.P0.Id})"); remoteSystems.Add(args.P0); RemoteSystemAdded?.Invoke(this, args); }