public static void ExportQuestionnaire(EDOConfig config, StudyUnitVM studyUnit)
 {
     ControlConstructSchemeVM controlConstructScheme = null;
     if (studyUnit.ControlConstructSchemes.Count > 1)
     {
         SelectObjectWindowVM<ControlConstructSchemeVM> vm = new SelectObjectWindowVM<ControlConstructSchemeVM>(studyUnit.ControlConstructSchemes);
         SelectObjectWindow window = new SelectObjectWindow(vm);
         controlConstructScheme = SelectObjectWindow.Select(Resources.SelectOrder, vm) as ControlConstructSchemeVM; //順序の選択
     }
     else if (studyUnit.ControlConstructSchemes.Count == 1)
     {
         controlConstructScheme = studyUnit.ControlConstructSchemes[0];
     }
     if (controlConstructScheme == null)
     {
         return;
     }
     string path = IOUtils.QuerySavePathName(Resources.ExportQuestionnair + ": " + controlConstructScheme.Title , null, QUESTIONNAIRE_FILTER, true);
     if (string.IsNullOrEmpty(path))
     {
         return;
     }
     try
     {
         QuestionnaireWriter writer = new QuestionnaireWriter(config, controlConstructScheme);
         writer.Write(path);
     }
     catch (Exception ex)
     {
         EDOUtils.ShowUnexpectedError(ex);
     }
 }
 public static object Select(string title, ISelectObjectWindowVM vm)
 {
     SelectObjectWindow dlg = new SelectObjectWindow(vm);
     dlg.Title = title;
     dlg.Owner = Application.Current.MainWindow;
     dlg.ShowDialog();
     if (dlg.DialogResult == true)
     {
         return dlg.SelectedObject;
     }
     return null;
 }
Beispiel #3
0
        public static object Select(string title, ISelectObjectWindowVM vm)
        {
            SelectObjectWindow dlg = new SelectObjectWindow(vm);

            dlg.Title = title;
            dlg.Owner = Application.Current.MainWindow;
            dlg.ShowDialog();
            if (dlg.DialogResult == true)
            {
                return(dlg.SelectedObject);
            }
            return(null);
        }
 public static void ExportSetupSyntax(StudyUnitVM studyUnit)
 {
     DataFileVM dataFile = null;
     if (studyUnit.DataFiles.Count > 1)
     {
         SelectObjectWindowVM<DataFileVM> vm = new SelectObjectWindowVM<DataFileVM>(studyUnit.DataFiles);
         SelectObjectWindow window = new SelectObjectWindow(vm);
         dataFile = SelectObjectWindow.Select(Resources.SelectDataFile, vm) as DataFileVM; //データファイルの選択
     }
     else if (studyUnit.DataFiles.Count == 1)
     {
         dataFile = studyUnit.DataFiles[0];
     }
     if (dataFile == null)
     {
         return;
     }
     string path = IOUtils.QuerySavePathName(Resources.ExportSetupSyntax, null, SETUPSYNTAX_FILTER, true); //セットアップシンタックスのエクスポート
     if (string.IsNullOrEmpty(path))
     {
         return;
     }
     try
     {
         SetupSyntaxWriter writer = new SetupSyntaxWriter(studyUnit, dataFile);
         writer.Write(path);
     }
     catch (Exception ex)
     {
         EDOUtils.ShowUnexpectedError(ex);
     }
 }
Beispiel #5
0
 public BookVM SelectBookExternal(BookRelation relation)
 {
     SelectObjectWindowVM<BookVM> vm = new SelectObjectWindowVM<BookVM>(books);
     SelectObjectWindow window = new SelectObjectWindow(vm);
     BookVM book = SelectObjectWindow.Select(Resources.SelectBook, vm) as BookVM; //文献の選択
     if (book != null)
     {
         using (UndoTransaction tx = new UndoTransaction(UndoManager))
         {
             if (book.Book.FindRelation(relation) == null)
             {
                 //ViewModelはEditBookWindowが表示されるたびに作りなおされるのでここで生成する必要はない。
                 book.Book.BookRelations.Add(relation);
             }
             StudyUnit.OnRemoveBooks();
             tx.Commit();
         }
     }
     return book;
 }