Example #1
0
        public SearchViewModel(
            IRegexService regexService,
            IResourceProvider resourceProvider,
            IApplicationDispatcher applicationDispatcher,
            SearchViewModelConfiguration searchViewModelConfiguration)
        {
            _regexService          = regexService;
            _applicationDispatcher = applicationDispatcher;

            ToggleSearchCommand = ReactiveCommand.Create(ToggleSearch);

            Reset();

            this.ValidationRule(
                vm => vm.SearchText,
                this.WhenAnyValue(x => x.IsRegexSearchEnabled, x => x.SearchText),
                v => !HasText || IsValid,
                _ => resourceProvider.GetResourceByName(searchViewModelConfiguration.InvalidRegexResourceName)
                );
            this.WhenAnyValue(
                x => x.SearchText,
                x => x.IsSearchEnabled,
                x => x.IsRegexSearchEnabled,
                x => x.IsSearchCaseSensitive,
                x => x.IsRecursiveSearchEnabled)
            .Throttle(TimeSpan.FromMilliseconds(searchViewModelConfiguration.TimeoutMs))
            .Subscribe(_ => FireSettingsChangedEvent());
        }
Example #2
0
        public DirectoryInformationDialogViewModel(
            IDirectoryService directoryService,
            IApplicationDispatcher applicationDispatcher,
            IMainNodeInfoTabViewModel mainNodeInfoTabViewModel)
        {
            _directoryService      = directoryService;
            _applicationDispatcher = applicationDispatcher;

            MainNodeInfoTabViewModel = mainNodeInfoTabViewModel;
        }
Example #3
0
        public DrivesListViewModel(
            IDriveService driveService,
            IDriveViewModelFactory driveViewModelFactory,
            IApplicationDispatcher applicationDispatcher)
        {
            _driveService          = driveService;
            _driveViewModelFactory = driveViewModelFactory;
            _applicationDispatcher = applicationDispatcher;
            _drives = new ObservableCollection <IDriveViewModel>();

            SubscribeToEvents();
            ReloadDrives();
        }
        public NotifyPropertyChangedViewModel(IEventAggregator eventAggregator, IApplicationDispatcher dispatcher)
        {
            if (eventAggregator == null)
            {
                throw new ArgumentNullException("EventAggregator is null");
            }
            if (dispatcher == null)
            {
                throw new ArgumentNullException("ApplicationDispatcher is null");
            }

            this.EventAggregator = eventAggregator;
            this.Dispatcher = dispatcher;
        }
Example #5
0
    public OperationsStatesListViewModel(
        IOperationsStateService operationsStateService,
        IOperationStateViewModelFactory operationStateViewModelFactory,
        IApplicationDispatcher applicationDispatcher,
        IDialogService dialogService,
        OperationsStatesConfiguration configuration)
    {
        _operationsStateService         = operationsStateService;
        _operationStateViewModelFactory = operationStateViewModelFactory;
        _applicationDispatcher          = applicationDispatcher;
        _dialogService = dialogService;

        _activeOperations               = new ObservableCollection <IOperationStateViewModel>();
        _finishedOperationsQueue        = new LimitedSizeStack <IOperationStateViewModel>(configuration.MaximumFinishedOperationsCount);
        _operationsViewModelsDictionary = new ConcurrentDictionary <IOperation, IOperationStateViewModel>();

        SubscribeToEvents();
    }
Example #6
0
        public SearchViewModel(
            IRegexService regexService,
            IResourceProvider resourceProvider,
            IApplicationDispatcher applicationDispatcher,
            SearchViewModelConfiguration searchViewModelConfiguration)
        {
            _regexService          = regexService;
            _applicationDispatcher = applicationDispatcher;

            Reset();

            this.ValidationRule(this.WhenAnyValue(x => x.IsRegexSearchEnabled, x => x.SearchText).Select(_ => IsValid),
                                resourceProvider.GetResourceByName(searchViewModelConfiguration.InvalidRegexResourceName));
            this.WhenAnyValue(x => x.SearchText, x => x.IsSearchEnabled,
                              x => x.IsRegexSearchEnabled, x => x.IsSearchCaseSensitive)
            .Throttle(TimeSpan.FromMilliseconds(searchViewModelConfiguration.TimeoutMs))
            .Subscribe(_ => FireSettingsChangedEvent());
        }
Example #7
0
    public DrivesListViewModel(
        IMountedDriveService mountedDriveService,
        IUnmountedDriveService unmountedDriveService,
        IDrivesUpdateService drivesUpdateService,
        IDriveViewModelFactory driveViewModelFactory,
        IApplicationDispatcher applicationDispatcher)
    {
        _mountedDriveService   = mountedDriveService;
        _unmountedDriveService = unmountedDriveService;
        _driveViewModelFactory = driveViewModelFactory;
        _applicationDispatcher = applicationDispatcher;

        _mountedDrivesDictionary   = new Dictionary <DriveModel, IDriveViewModel>();
        _unmountedDrivesDictionary = new Dictionary <UnmountedDriveModel, IDriveViewModel>();

        SubscribeToEvents();
        LoadDrives();

        drivesUpdateService.Start();
    }
Example #8
0
 public DialogService(IApplicationDispatcher applicationDispatcher, IMainWindowProvider mainWindowProvider, IClipboardService clipboardService)
 {
     _applicationDispatcher = applicationDispatcher;
     _mainWindowProvider    = mainWindowProvider;
     _clipboardService      = clipboardService;
 }
Example #9
0
 public AppsService(IAppRepository appRepository, AppService appService, IApplicationDispatcher dispatcher)
 {
     this.dispatcher    = dispatcher;
     this.appRepository = appRepository;
     this.appService    = appService;
 }
Example #10
0
 public HomePageViewModel(IEventAggregator eventAggregator,
                          IApplicationDispatcher dispatcher,
                          IRepositoryFactory repositoryFactory,
                          IEntityFactory entityFactory) :  base(eventAggregator, dispatcher)
 {
     this.RepositoryFactory = repositoryFactory;
     this.EntityFactory = entityFactory;
     this.SubscribeToEvents();
     this.GetNotesAsync();
 }