コード例 #1
0
        public MainWindowModel(
            ISelectExecuteFileService selectExecuteFileService,
            IShortcutService shortcutService,
            IDialogService dialogService,
            IOpenExolorerService openExolorerService)
        {
            _selectExecuteFileService = selectExecuteFileService;
            _shortcutService          = shortcutService;
            _dialogService            = dialogService;
            _openExolorerService      = openExolorerService;

            _wathcer = new FileSystemWatcher(StartupPath, "*.*")
            {
                EnableRaisingEvents = true
            };
            StartupShortcuts = new[]
            {
                _wathcer.CreatedAsObservable(),
                    _wathcer.ChangedAsObservable(),
                    _wathcer.DeletedAsObservable(),
                    _wathcer.RenamedAsObservable()
            }
            .Merge()
            .Select(_ => GetStartupShorcuts())
            .ToReadOnlyReactivePropertySlim(GetStartupShorcuts());
        }