private void SubscribeToReaderEvents(IMonitorFactory monitorFactory, IReadOnlyCollection <string> readerNames) { _subscription?.Dispose(); if (readerNames.Count <= 0) { return; } _subscription = monitorFactory .CreateObservable(SCardScope.System, readerNames) .Do(ev => EventHistory.AddOnScheduler(ev)) // Always add elements using the UI scheduler! .Subscribe( onNext: _ => { }, onError: OnError); }