예제 #1
0
파일: Coverage.cs 프로젝트: ssjda-ddi/EDO
        public static Coverage CreateDefault()
        {
            Coverage coverage = new Coverage();

            foreach (Option option in Options.CoverageTopics)
            {
                CheckOption checkOption = new CheckOption(option.Code, option.Label);
                if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE)
                {
                    checkOption.HasMemo = true;
                }
                coverage.Topics.Add(checkOption);
            }
            foreach (Option option in Options.CoverageAreas)
            {
                CheckOption checkOption = new CheckOption(option.Code, option.Label);
                coverage.Areas.Add(checkOption);
            }
            return(coverage);
        }
예제 #2
0
        /// <summary>
        /// デフォルト設定を適用したStudyUnitを作成します。minimunをtrueにすると、最低限の設定のみを行ったStudyUnitを返します。
        /// </summary>
        /// <param name="minimum">設定を最低限にするかどうか</param>
        /// <returns>デフォルト設定を適用したStudyUnit</returns>
        public static StudyUnit CreateDefault(bool minimum = false)
        {
            StudyUnit studyUnit = new StudyUnit();
            int       i         = 1;

            if (!minimum)
            {
                foreach (Option option in Options.EventTypes)
                {
                    studyUnit.Events.Add(new Event()
                    {
                        Title = option.Label, No = i++
                    });
                }
                studyUnit.FundingInfos.Add(new FundingInfo());
                studyUnit.Samplings.Add(new Sampling());
                studyUnit.ConceptSchemes.Add(new ConceptScheme());
                ControlConstructScheme scheme = new ControlConstructScheme();
                studyUnit.ControlConstructSchemes.Add(scheme);
                studyUnit.DefaultControlConstructSchemeId = scheme.Id;
                DataSet dataSet = new DataSet();
                dataSet.Title = EDOConstants.LABEL_ALL;
                dataSet.Memo  = Resources.AllDataSet; //All variables
                studyUnit.DefaultDataSetId = dataSet.Id;
                studyUnit.DataSets.Add(dataSet);

                dataSet.IsCreatedDataFile = true;
                DataFile dataFile = DataFile.createDataFile();
                dataFile.DataSetId = dataSet.Id;
                studyUnit.DataFiles.Add(dataFile);

                studyUnit.CreateBinaryCodeScheme();
            }

            studyUnit.Coverage = Coverage.CreateDefault();

            return(studyUnit);
        }
예제 #3
0
        public CoverageFormVM(StudyUnitVM studyUnit)
            : base(studyUnit)
        {
            coverage = studyUnit.CoverageModel;
            topics = new ObservableCollection<CheckOptionVM>();
            foreach (CheckOption topic in coverage.Topics) {
                topics.Add(new CheckOptionVM(this, topic));
            }
            areas = new ObservableCollection<CheckOptionVM>();
            foreach (CheckOption area in coverage.Areas)
            {
                areas.Add(new CheckOptionVM(this, area));
            }
            keywords = new ObservableCollection<KeywordVM>();
            foreach (Keyword keywordModel in coverage.Keywords)
            {
                KeywordVM keyword = new KeywordVM(keywordModel);
                InitKeyword(keyword);
                keywords.Add(keyword);
            }

            modelSyncher = new ModelSyncher<KeywordVM, Keyword>(this, keywords, coverage.Keywords);
        }
예제 #4
0
 public static Coverage CreateDefault()
 {
     Coverage coverage = new Coverage();
     foreach (Option option in Options.CoverageTopics)
     {
         CheckOption checkOption = new CheckOption(option.Code, option.Label);
         if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE)
         {
             checkOption.HasMemo = true;
         }
         coverage.Topics.Add(checkOption);
     }
     foreach (Option option in Options.CoverageAreas)
     {
         CheckOption checkOption = new CheckOption(option.Code, option.Label);
         coverage.Areas.Add(checkOption);
     }
     return coverage;
 }