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 void ExportGroup(EDOConfig config, GroupVM group, List<StudyUnitVM> studyUnits) { string path = IOUtils.QuerySavePathName(Resources.GroupExport, null, DDI_GROUP_FILTER, true); if (string.IsNullOrEmpty(path)) { return; } DDI3Writer writer = new DDI3Writer(config); writer.WriteGroup(path, group, studyUnits); DDI3Reader.Validate(path); }
public ConfigWindowVM(EDOConfig config) { this.config = config; ReopenLastFile = config.ReopenLastFile; UndoBufferCount = config.UndoBufferCount; Languages = new ObservableCollection<Option>() { new Option("ja", "日本語"), new Option("en", "English") }; language = SelectLanguage(Languages, config.Language); ShouldRestart = false; }
public MainWindow() { // MessageBox.Show(System.Environment.CurrentDirectory); // System.Configuration.Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal); // MessageBox.Show("Local user config path: " + configuration.FilePath); config = new EDOConfig(); ChangeLanguage(); InitializeComponent(); viewModel = new MainWindowVM(config); viewModel.Window = this; this.DataContext = viewModel; }
public static void ExportStudyUnit(EDOConfig config, StudyUnitVM studyUnit) { FileDialogResult result = IOUtils.QuerySavePathNameEx(string.Format(Resources.StudyUnitExport, studyUnit.Title), null, DDI_FILE_FILTER, true); if (result == null) { return; } if (result.FilterIndex == DDI3_FILTER_INDEX) { DDI3Writer writer = new DDI3Writer(config); writer.WriteStudyUnit(result.FileName, studyUnit); DDI3Reader.Validate(result.FileName); } else if (result.FilterIndex == DDI2_FILTER_INDEX) { DDI2Writer writer = new DDI2Writer(config); writer.WriteCodebook(result.FileName, studyUnit); DDI2Reader.Validate(result.FileName); } }
public MainWindowVM(EDOConfig config) { //手動で英語環境のテストをしたい場合以下を有効にする Options.Init(); this.config = config; recentFileList = new RecentFileList(); List<string> files = recentFileList.RecentFiles; foreach (string file in files) { Debug.WriteLine(file); } edoUnits = new ObservableCollection<EDOUnitVM>(); undoManager = new UndoManager(); undoManager.UndoBufferCount = config.UndoBufferCount; undoManager.ModelChangeHandler += OnModelChanged; if (config.ReopenLastFile && File.Exists(config.LastFile)) { DoOpen(false, config.LastFile); } if (edoModel == null) { edoModel = EDOModel.createDefault(); createViewModels(edoModel); undoManager.Init(edoModel, this); UpdateRecentFiles(); } this.HelpCommand = new HelpCommandImpl(this); this.AddCommand = new AddCommandImpl(this); this.StatusMessage = "Ready"; this.IsErrorMessage = true; this.Title = DEFAULT_TITLE; this.IsTextBoxChanged = false; // var xdoc = XDocument.Parse(Resources.Options); // Debug.WriteLine(xdoc.ToString()); this.isRestarting = false; }
public QuestionnaireWriter(EDOConfig config, ControlConstructSchemeVM controlConstructScheme) { this.config = config; this.controlConstructScheme = controlConstructScheme; }
public DDI3Writer(EDOConfig config) { this.config = config; }
public ConfigWindow(EDOConfig config) { InitializeComponent(); viewModel = new ConfigWindowVM(config); DataContext = viewModel; }
public DDI2Writer(EDOConfig config) { this.config = config; convertIds = new Dictionary<string, string>(); }