public MainShellViewModel(IProjectSuiteController projectSuiteController, IRecordingController recordingController, ITestFileManager testFileManager) { this.projectSuiteController = projectSuiteController; this.recordingController = recordingController; this.testFileManager = testFileManager; NewProjectSuiteCommand = new DelegateCommand(ExecuteNewProjectSuiteCommand); OpenProjectSuiteCommand = new DelegateCommand(ExecuteOpenProjectSuiteCommand); RecordCommand = new DelegateCommand(ExecuteRecordCommand, CanExecuteRecordCommand); }
public RecentFileViewModel(string filePath, IProjectSuiteController projectSuiteController) { this.filePath = filePath; this.projectSuiteController = projectSuiteController; FileInfo fileInfo = new FileInfo(filePath); FileName = fileInfo.Name; OpenFileCommand = new DelegateCommand(ExecuteOpenFileCommand); }
public StartPageViewModel(IProjectSuiteController projectSuiteController, IRecentFileViewModelFactory recentFileViewModelFactory, IRecentFileManager recentFileManager) { this.projectSuiteController = projectSuiteController; this.recentFileViewModelFactory = recentFileViewModelFactory; NewProjectSuiteCommand = new DelegateCommand(ExecuteNewProjectCommand); OpenProjectSuiteCommand = new DelegateCommand(ExecuteOpenProjectCommand); string filePath = DefaultData.GoldenHorseRecentProjectsFilePath; if (!File.Exists(filePath)) return; string[] projects = recentFileManager.GetRecentFiles(); RecentFiles = projects.Select(recentFileViewModelFactory.Create).ToArray(); }
public NewProjectSuiteViewModel(IProjectSuiteController projectSuiteController) { this.projectSuiteController = projectSuiteController; BrowseCommand = new DelegateCommand(ExecuteBrowseCommand); saveNewProjectSuiteCommand = new DelegateCommand(ExecuteSaveNewProjectSuiteCommand, CanExecuteSaveNewProjectSuiteCommand); SaveNewProjectSuiteCommand = saveNewProjectSuiteCommand; CancelNewProjectSuiteCommand = new DelegateCommand(ExecuteCancelNewProjectSuiteCommand); Location = DefaultData.GoldenHorseProjectsLocation; string prefix = "Project"; string locationToCheck = DefaultData.GoldenHorseProjectsLocation; var newName = DefaultNameHelper.GetDefaultName(locationToCheck, prefix); Name = newName; autoSetLocation = false; }