Exemple #1
0
        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; //Select Data File
            }
            else if (studyUnit.DataFiles.Count == 1)
            {
                dataFile = studyUnit.DataFiles[0];
            }
            if (dataFile == null)
            {
                return;
            }
            string path = IOUtils.QuerySavePathName(Resources.ExportSetupSyntax, null, SETUPSYNTAX_FILTER, true); //Export Setup Syntax

            if (string.IsNullOrEmpty(path))
            {
                return;
            }
            try
            {
                SetupSyntaxWriter writer = new SetupSyntaxWriter(studyUnit, dataFile);
                writer.Write(path);
            }
            catch (Exception ex)
            {
                EDOUtils.ShowUnexpectedError(ex);
            }
        }
 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);
     }
 }