Exemplo n.º 1
0
        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));
                }
            }
        }
Exemplo n.º 2
0
        private void LoadTest(object obj)
        {
            TestManager test = new TestManager(ServiceProvider.GetApplicationSettings);

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