public FolderViewModel( IFileSystemService fileSystemService, FolderNode currentDirectory = null) { fileSystemService.CheckWhetherArgumentIsNull(nameof(fileSystemService)); this.fileSystemService = fileSystemService; this.currentDirectory = currentDirectory ?? this.fileSystemService.RootDirectoryTree; }
public MainViewModel( IAppSettingsService appSettingsService, IFileSystemService fileSystemService, RibbonMenuViewModel ribbonMenuViewModel) { appSettingsService.CheckWhetherArgumentIsNull(nameof(appSettingsService)); fileSystemService.CheckWhetherArgumentIsNull(nameof(fileSystemService)); ribbonMenuViewModel.CheckWhetherArgumentIsNull(nameof(ribbonMenuViewModel)); this.appSettingsService = appSettingsService; this.fileSystemService = fileSystemService; this.Ribbon = ribbonMenuViewModel; var previousDocumentRoot = this.appSettingsService.GetSetting(Constants.DocumentRoot); this.documentRoot = previousDocumentRoot?.SettingValue.ToString() ?? AppDomain.CurrentDomain.BaseDirectory; this.fileSystemService.SetRootDirectory(this.documentRoot); this.FileExplorer = new FileExplorerViewModel(this.fileSystemService.ReadRootDirectory()); this.FolderViewModel = new FolderViewModel(this.fileSystemService); this.SetupTabs(); }