private void Browse(object obj)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "QM test (*.qm)|*.qm",
                Title  = "Select Qucik Mark test ..."
            };

            if (openFileDialog.ShowDialog() == true)
            {
                TestManager test = new TestManager(ServiceProvider.GetApplicationSettings);
                if (test.LoadTestData(openFileDialog.FileName))
                {
                    string destinationPath = Path.Combine(ServiceProvider.GetApplicationSettings.TestStorageFolderPath, Path.GetFileName(openFileDialog.FileName));

                    if (!File.Exists(destinationPath))//do backup copy of selected file
                    {
                        File.Copy(openFileDialog.FileName, destinationPath);
                    }
                    else if (openFileDialog.FileName == destinationPath)//the selected file is the backupfile stored in TestStorageFolderPath
                    {
                        File.SetLastAccessTime(destinationPath, DateTime.Now);
                    }
                    else//replace
                    {
                        File.Delete(destinationPath);
                        File.Copy(openFileDialog.FileName, destinationPath);
                        File.SetLastAccessTime(destinationPath, DateTime.Now);
                    }
                    ChangePageEvent.Invoke(this, new TestMakerViewModel(ChangePageEvent, test));
                }
            }
        }
        private void LoadTest(object obj)
        {
            TestManager test = new TestManager(ServiceProvider.GetApplicationSettings);

            if (test.LoadTestData(SelectedTestDataPreview.FullPath))
            {
                ChangePageEvent.Invoke(this, new TestMakerViewModel(ChangePageEvent, test));
            }
        }
 private void ShowMainMenuPage(object obj)
 {
     ChangePageEvent.Invoke(this, new MainMenu.MainMenuViewModel(ChangePageEvent));
 }
Beispiel #4
0
 private void ShowBasicSettingsPage(object obj)
 {
     ChangePageEvent.Invoke(this, new Settings.BasicSettingsViewModel(ChangePageEvent));
 }
Beispiel #5
0
 private void ShowTypeSelectorPage(object obj)
 {
     ChangePageEvent.Invoke(this, new TestCreator.TypeSelectorViewModel(ChangePageEvent));
 }
Beispiel #6
0
 private void ShowTestLoaderPage(object obj)
 {
     ChangePageEvent.Invoke(this, new TestMaker.TestLoaderViewModel(ChangePageEvent));
 }