public ErrorsViewModel(IDirectorySearchHandler searchHandler) { this.Errors = new ObservableCollection <string>(); searchHandler.Error.ObserveOn(RxApp.MainThreadScheduler).Subscribe(o => this.Errors.Add(o)); this.Clear = ReactiveCommand.Create(() => this.Errors.Clear()); }
public MainViewModel(IDirectorySearchHandler handler, IFolderPathProvider folderPathProvider) { this.StartSearch = ReactiveCommand.Create(() => { var path = folderPathProvider.GetPath(); if (string.IsNullOrWhiteSpace(path)) { return; } this.CancellationTokenSource = new CancellationTokenSource(); handler.StartHandler(path, this.CancellationTokenSource.Token); }); this.StopSearch = ReactiveCommand.Create(() => { if (this.CancellationTokenSource == null || this.CancellationTokenSource.IsCancellationRequested) { return; } this.CancellationTokenSource.Cancel(); }); }
public SeralizationHandler(IDirectorySearchHandler searchHandler, IProgresNotifier progresNotifier, ISavePathProvider savePathProvider) { this.progresNotifier = progresNotifier; this.searchHandler = searchHandler; this.savePathProvider = savePathProvider; }
public UIHandler(IDirectorySearchHandler searchHandler) { this.searchHandler = searchHandler; this.itemUpdated = new Subject <Item>(); }