Ejemplo n.º 1
0
        public DDISerializer(DDIVersion ddiVersion)
        {
            DDIVersion = ddiVersion;
            switch (DDIVersion)
            {
            case DDIVersion.DDI2_5:
                writer = new DDI2Writer();
                reader = new DDI2Reader();
                break;

            case DDIVersion.DDI3_1:
                writer = new DDI3Writer();
                reader = new DDI3Reader();
                break;

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 2
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);
     }
 }