コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
        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;
        }
コード例 #7
0
 public QuestionnaireWriter(EDOConfig config, ControlConstructSchemeVM controlConstructScheme)
 {
     this.config = config;
     this.controlConstructScheme = controlConstructScheme;
 }
コード例 #8
0
ファイル: DDI3Writer.cs プロジェクト: Easy-DDI-Organizer/EDO
 public DDI3Writer(EDOConfig config)
 {
     this.config = config;
 }
コード例 #9
0
 public ConfigWindow(EDOConfig config)
 {
     InitializeComponent();
     viewModel = new ConfigWindowVM(config);
     DataContext = viewModel;
 }
コード例 #10
0
ファイル: DDI2Writer.cs プロジェクト: Easy-DDI-Organizer/EDO
 public DDI2Writer(EDOConfig config)
 {
     this.config = config;
     convertIds = new Dictionary<string, string>();
 }