public SamplingFormVM(StudyUnitVM studyUnit) : base(studyUnit) { samplings = new ObservableCollection<SamplingVM>(); //タイトルの命名方法を他のところと変える。 //・EXCELのシート名のように使われていないユニークなタイトルを見つける。 //・変数のイメージや助成金などは自分でタイトルを変更することができるが、 //ここではできないため。 HashSet<string> titles = Sampling.CollectTitles(studyUnit.SamplingModels); foreach (Sampling samplingModel in studyUnit.SamplingModels) { int uniqIndex = EDOUtils.UniqOrderNo(titles, samplingModel.Title, PREFIX); SamplingVM sampling = new SamplingVM(samplingModel) { Parent = this, OrderNo = uniqIndex, OrderPrefix = PREFIX }; sampling.Init(); samplings.Add(sampling); titles.Add(sampling.Title); //タイトルセットに追加。 } modelSyncher = new ModelSyncher<SamplingVM, Sampling>(this, samplings, studyUnit.SamplingModels); }
public MemberFormVM(StudyUnitVM studyUnit) : base(studyUnit) { members = new ObservableCollection<MemberVM>(); organizations = new ObservableCollection<OrganizationVM>(); //OrganizationVMのリストを生成する(画面下部に表示される他、メンバーの組織選択コンボで使われる) int i = 1; foreach (Organization organizationModel in studyUnit.OrganizationModels) { OrganizationVM organization = new OrganizationVM(organizationModel); InitExistOrganization(organization, i++); organizations.Add(organization); } //MemberVMのリストを生成する i = 1; foreach (Member memberModel in studyUnit.MemberModels) { OrganizationVM organization = OrganizationVM.Find(organizations, memberModel.OrganizationId); MemberVM member = new MemberVM(memberModel, organization.OrganizationName); InitExistMember(member, i++); members.Add(member); } memberSyncher = new ModelSyncher<MemberVM, Member>(this, members, studyUnit.MemberModels); organizationSyncher = new ModelSyncher<OrganizationVM, Organization>(this, organizations, studyUnit.OrganizationModels); }
public BookFormVM(StudyUnitVM studyUnit) : base(studyUnit) { books = new ObservableCollection<BookVM>(); foreach (Book bookModel in studyUnit.BookModels) { BookVM book = new BookVM(bookModel) { Parent = this }; books.Add(book); } modelSyncher = new ModelSyncher<BookVM, Book>(this, books, studyUnit.BookModels); }
public CodeFormVM(StudyUnitVM studyUnit) : base(studyUnit) { codeSchemes = new ObservableCollection<CodeSchemeVM>(); foreach (CodeScheme codeSchemeModel in studyUnit.CodeSchemeModels) { CodeSchemeVM codeScheme = CreateCodeScheme(codeSchemeModel); codeSchemes.Add(codeScheme); } modelSyncher = new ModelSyncher<CodeSchemeVM, CodeScheme>(this, codeSchemes, studyUnit.CodeSchemeModels); }
public CategoryFormVM(StudyUnitVM studyUnit) : base(studyUnit) { categorySchemes = new ObservableCollection<CategorySchemeVM>(); foreach (CategoryScheme categorySchemeModel in studyUnit.CategorySchemeModels) { CategorySchemeVM categoryScheme = new CategorySchemeVM(categorySchemeModel) { Parent = this }; categorySchemes.Add(categoryScheme); } modelSyncher = new ModelSyncher<CategorySchemeVM, CategoryScheme>(this, categorySchemes, studyUnit.CategorySchemeModels); }
public CodeSchemeVM(CodeScheme codeScheme, ObservableCollection<CodeVM> codes) { this.codeScheme = codeScheme; this.codes = codes; foreach (CodeVM code in codes) { code.Parent = this; } modelSyncher = new ModelSyncher<CodeVM, Code>(this, codes, codeScheme.Codes); modelSyncher.AddActionHandler = (param) => { param.CodeSchemeId = codeScheme.Id; }; }
public ConceptSchemeVM(ConceptScheme conceptScheme) { this.conceptScheme = conceptScheme; concepts = new ObservableCollection<ConceptVM>(); foreach (Concept conceptModel in conceptScheme.Concepts) { ConceptVM conceptVM = new ConceptVM(conceptModel); conceptVM.Parent = this; concepts.Add(conceptVM); } modelSyncher = new ModelSyncher<ConceptVM, Concept>(this, concepts, conceptScheme.Concepts); string message = Properties.Resources.ConceptFormHelpMessage1; TestMessage = message; }
public DataSetVM(DataSet dataSet, ObservableCollection<DataSetVariableVM> dataSetVariables) { this.dataSet = dataSet; variables = new ObservableCollection<DataSetVariableVM>(); int i = 1; foreach (DataSetVariableVM variable in dataSetVariables) { variable.Parent = this; variable.Position = i++; variables.Add(variable); } modelSyncer = new ModelSyncher<DataSetVariableVM, string>(this, variables, dataSet.VariableGuids); modelSyncer.AddActionHandler = (param) => { param.Position = NextPosition; }; }
public SamplingVM(Sampling sampling) { this.sampling = sampling; this.universes = new ObservableCollection<UniverseVM>(); foreach (Universe universeModel in sampling.Universes) { UniverseVM universe = new UniverseVM(universeModel); universe.Parent = this; universes.Add(universe); } samplingMethods = Options.SamplingMethods; modelSyncher = new ModelSyncher<UniverseVM, Universe>(this, universes, sampling.Universes); }
public DataFileFormVM(StudyUnitVM studyUnit) : base(studyUnit) { dataFiles = new ObservableCollection<DataFileVM>(); foreach (DataFile dataFileModel in studyUnit.DataFileModels) { DataSetVM dataSet = studyUnit.FindDataSet(dataFileModel.DataSetId); if (dataSet != null) { DataFileVM dataFile = createDataFile(dataFileModel, dataSet); dataFiles.Add(dataFile); } } modelSyncher = new ModelSyncher<DataFileVM, DataFile>(this, dataFiles, studyUnit.DataFileModels); }
public CategorySchemeVM(CategoryScheme categoryScheme) { this.categoryScheme = categoryScheme; categories = new ObservableCollection<CategoryVM>(); foreach (Category categoryModel in categoryScheme.Categories) { CategoryVM category = new CategoryVM(categoryModel); category.Parent = this; categories.Add(category); } modelSyncher = new ModelSyncher<CategoryVM, Category>(this, categories, categoryScheme.Categories); modelSyncher.AddActionHandler = (param) => { param.CategorySchemeId = Id; }; }
public CategorySchemeVM(CategoryScheme categoryScheme) { this.categoryScheme = categoryScheme; categories = new ObservableCollection <CategoryVM>(); foreach (Category categoryModel in categoryScheme.Categories) { CategoryVM category = new CategoryVM(categoryModel); category.Parent = this; categories.Add(category); } modelSyncher = new ModelSyncher <CategoryVM, Category>(this, categories, categoryScheme.Categories); modelSyncher.AddActionHandler = (param) => { param.CategorySchemeId = Id; }; }
public QuestionGroupFormVM(StudyUnitVM studyUnit) : base(studyUnit) { ObservableCollection<QuestionVM> allQuestions = studyUnit.AllQuestions; questionGroups = new ObservableCollection<QuestionGroupVM>(); foreach (QuestionGroup questionGroupModel in studyUnit.QuestionGroupModels) { QuestionGroupVM questionGroup = new QuestionGroupVM(questionGroupModel, allQuestions) { Parent = this }; questionGroups.Add(questionGroup); } modelSyncher = new ModelSyncher<QuestionGroupVM, QuestionGroup>(this, questionGroups, studyUnit.QuestionGroupModels); }
public VariableFormVM(StudyUnitVM studyUnit) : base(studyUnit) { variables = new ObservableCollection<VariableVM>(); foreach (Variable variableModel in studyUnit.VariableModels) { //VariableVMの生成 VariableVM variable = new VariableVM(variableModel); InitVariable(variable); //ResponseVMの生成 variable.Response = CreateResponse(variableModel.Response); //配列に追加 variables.Add(variable); } modelSyncher = new ModelSyncher<VariableVM, Variable>(this, variables, studyUnit.VariableModels); }
public QuestionGroupFormVM(StudyUnitVM studyUnit) : base(studyUnit) { ObservableCollection <QuestionVM> allQuestions = studyUnit.AllQuestions; questionGroups = new ObservableCollection <QuestionGroupVM>(); foreach (QuestionGroup questionGroupModel in studyUnit.QuestionGroupModels) { QuestionGroupVM questionGroup = new QuestionGroupVM(questionGroupModel, allQuestions) { Parent = this }; questionGroups.Add(questionGroup); } modelSyncher = new ModelSyncher <QuestionGroupVM, QuestionGroup>(this, questionGroups, studyUnit.QuestionGroupModels); }
public EventFormVM(StudyUnitVM studyUnit) : base(studyUnit) { events = new ObservableCollection <EventVM>(); foreach (Event eventModel in studyUnit.EventModels) { EventVM ev = new EventVM(eventModel); InitEvent(ev); events.Add(ev); } modelSyncher = new ModelSyncher <EventVM, Event>(this, events, studyUnit.EventModels); contents = new ObservableCollection <string>(); foreach (Option option in Options.EventTypes) { contents.Add(option.Label); } }
public ConceptFormVM(StudyUnitVM studyUnit) : base(studyUnit) { this.conceptSchemes = new ObservableCollection<ConceptSchemeVM>(); int i = 1; foreach (ConceptScheme conceptSchemeModel in studyUnit.ConceptSchemeModels) { ConceptSchemeVM conceptScheme = new ConceptSchemeVM(conceptSchemeModel) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; conceptScheme.InitTitle(); conceptSchemes.Add(conceptScheme); } modelSyncher = new ModelSyncher<ConceptSchemeVM, ConceptScheme>(this, conceptSchemes, studyUnit.ConceptSchemeModels); allConcepts = new ObservableCollection<ConceptVM>(); }
private static readonly string PREFIX = Resources.FundMoney; //Amount public FundingInfoFormVM(StudyUnitVM studyUnitVM) : base(studyUnitVM) { fundingInfos = new ObservableCollection <FundingInfoVM>(); int i = 1; foreach (FundingInfo fundingInfoModel in studyUnitVM.FundingInfoModels) { FundingInfoVM fundingInfo = new FundingInfoVM(fundingInfoModel) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; fundingInfo.InitTitle(); fundingInfos.Add(fundingInfo); } modelSyncher = new ModelSyncher <FundingInfoVM, FundingInfo>(this, fundingInfos, studyUnitVM.FundingInfoModels); }
public EventFormVM(StudyUnitVM studyUnit) : base(studyUnit) { events = new ObservableCollection<EventVM>(); foreach (Event eventModel in studyUnit.EventModels) { EventVM ev = new EventVM(eventModel); InitEvent(ev); events.Add(ev); } modelSyncher = new ModelSyncher<EventVM, Event>(this, events, studyUnit.EventModels); contents = new ObservableCollection<string>(); foreach (Option option in Options.EventTypes) { contents.Add(option.Label); } }
public FundingInfoFormVM(StudyUnitVM studyUnitVM) : base(studyUnitVM) { fundingInfos = new ObservableCollection<FundingInfoVM>(); int i = 1; foreach (FundingInfo fundingInfoModel in studyUnitVM.FundingInfoModels) { FundingInfoVM fundingInfo = new FundingInfoVM(fundingInfoModel) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; fundingInfo.InitTitle(); fundingInfos.Add(fundingInfo); } modelSyncher = new ModelSyncher<FundingInfoVM, FundingInfo>(this, fundingInfos, studyUnitVM.FundingInfoModels); }
public ConceptFormVM(StudyUnitVM studyUnit) : base(studyUnit) { this.conceptSchemes = new ObservableCollection <ConceptSchemeVM>(); int i = 1; foreach (ConceptScheme conceptSchemeModel in studyUnit.ConceptSchemeModels) { ConceptSchemeVM conceptScheme = new ConceptSchemeVM(conceptSchemeModel) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; conceptScheme.InitTitle(); conceptSchemes.Add(conceptScheme); } modelSyncher = new ModelSyncher <ConceptSchemeVM, ConceptScheme>(this, conceptSchemes, studyUnit.ConceptSchemeModels); allConcepts = new ObservableCollection <ConceptVM>(); }
public SequenceFormVM(StudyUnitVM studyUnit) : base(studyUnit) { controlConstructSchemes = new ObservableCollection<ControlConstructSchemeVM>(); int i = 1; foreach (ControlConstructScheme model in studyUnit.ControlConstructSchemeModels) { ControlConstructSchemeVM controlConstructScheme = new ControlConstructSchemeVM(model) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; controlConstructScheme.Init(); controlConstructSchemes.Add(controlConstructScheme); } modelSyncher = new ModelSyncher<ControlConstructSchemeVM, ControlConstructScheme>( this, controlConstructSchemes, studyUnit.ControlConstructSchemeModels); }
private static readonly string PREFIX = Resources.Sequence; //Sequence public SequenceFormVM(StudyUnitVM studyUnit) : base(studyUnit) { controlConstructSchemes = new ObservableCollection <ControlConstructSchemeVM>(); int i = 1; foreach (ControlConstructScheme model in studyUnit.ControlConstructSchemeModels) { ControlConstructSchemeVM controlConstructScheme = new ControlConstructSchemeVM(model) { Parent = this, OrderNo = i++, OrderPrefix = PREFIX }; controlConstructScheme.Init(); controlConstructSchemes.Add(controlConstructScheme); } modelSyncher = new ModelSyncher <ControlConstructSchemeVM, ControlConstructScheme>( this, controlConstructSchemes, studyUnit.ControlConstructSchemeModels); }
private void Init(string detailTypeCode, decimal?min, decimal?max, CodeSchemeVM codeScheme, List <MissingValue> missingValueModels, ResponseLayout layoutModel) { DetailTypeCode = detailTypeCode; Min = min; Max = max; CodeScheme = codeScheme; DetailTypes = new ObservableCollection <Option>(); if (response.IsTypeChoices) { } else if (response.IsTypeDateTime) { DetailTypes = Options.DateTimeTypes; } else if (response.IsTypeFree) { } else if (response.IsTypeNumber) { DetailTypes = Options.NumberTypes; } missingValues = new ObservableCollection <MissingValueVM>(); foreach (MissingValue mv in missingValueModels) { MissingValueVM missingValue = new MissingValueVM(mv) { Parent = this }; missingValues.Add(missingValue); } modelSyncher = new ModelSyncher <MissingValueVM, MissingValue>(this, missingValues, response.MissingValues); ResponseLayout newLayoutModel = layoutModel; layout = CreateLayout(response, layoutModel); response.Layout = layout.Layout; }
public DataSetFormVM(StudyUnitVM studyUnit) : base(studyUnit) { dataSets = new ObservableCollection <DataSetVM>(); foreach (DataSet dataSetModel in studyUnit.DataSetModels) { ObservableCollection <DataSetVariableVM> variables = new ObservableCollection <DataSetVariableVM>(); foreach (string guid in dataSetModel.VariableGuids) { DataSetVariableVM v = createDataSetVariable(guid); if (v != null) { variables.Add(v); } } DataSetVM dataSet = new DataSetVM(dataSetModel, variables) { Parent = this }; dataSets.Add(dataSet); } modelSyncher = new ModelSyncher <DataSetVM, DataSet>(this, dataSets, studyUnit.DataSetModels); }
public DataSetFormVM(StudyUnitVM studyUnit) : base(studyUnit) { dataSets = new ObservableCollection<DataSetVM>(); foreach (DataSet dataSetModel in studyUnit.DataSetModels) { ObservableCollection<DataSetVariableVM> variables = new ObservableCollection<DataSetVariableVM>(); foreach (string guid in dataSetModel.VariableGuids) { DataSetVariableVM v = createDataSetVariable(guid); if (v != null) { variables.Add(v); } } DataSetVM dataSet = new DataSetVM(dataSetModel, variables) { Parent = this }; dataSets.Add(dataSet); } modelSyncher = new ModelSyncher<DataSetVM, DataSet>(this, dataSets, studyUnit.DataSetModels); }
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); }
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); }
private void Init(string detailTypeCode, decimal? min, decimal? max, CodeSchemeVM codeScheme, List<MissingValue> missingValueModels, ResponseLayout layoutModel) { DetailTypeCode = detailTypeCode; Min = min; Max = max; CodeScheme = codeScheme; DetailTypes = new ObservableCollection<Option>(); if (response.IsTypeChoices) { } else if (response.IsTypeDateTime) { DetailTypes = Options.DateTimeTypes; } else if (response.IsTypeFree) { } else if (response.IsTypeNumber) { DetailTypes = Options.NumberTypes; } missingValues = new ObservableCollection<MissingValueVM>(); foreach (MissingValue mv in missingValueModels) { MissingValueVM missingValue = new MissingValueVM(mv) { Parent = this }; missingValues.Add(missingValue); } modelSyncher = new ModelSyncher<MissingValueVM, MissingValue>(this, missingValues, response.MissingValues); ResponseLayout newLayoutModel = layoutModel; layout = CreateLayout(response, layoutModel); response.Layout = layout.Layout; }
public void Init() { List<string> ids = controlConstructScheme.Sequence.ControlConstructIds; foreach (string id in ids) { QuestionConstruct questionConstructModel = controlConstructScheme.FindQuestionConstruct(id); if (questionConstructModel != null) { QuestionVM question = StudyUnit.FindQuestion(questionConstructModel.QuestionId); Debug.Assert(question != null, "Question not found id=" + questionConstructModel.QuestionId); QuestionConstructVM questionConstruct = new QuestionConstructVM(questionConstructModel, question); InitConstruct(questionConstruct); constructModels.Add(questionConstructModel); constructs.Add(questionConstruct); continue; } QuestionGroupConstruct questionGroupConstructModel = controlConstructScheme.FindQuestionGroupConstruct(id); if (questionGroupConstructModel != null) { QuestionGroupVM questionGroup = StudyUnit.FindQuestionGroup(questionGroupConstructModel.QuestionGroupId); QuestionGroupConstructVM questionGroupConstruct = new QuestionGroupConstructVM(questionGroupConstructModel, questionGroup); InitConstruct(questionGroupConstruct); constructModels.Add(questionGroupConstructModel); constructs.Add(questionGroupConstruct); continue; } Statement statementModel = controlConstructScheme.FindStatement(id); if (statementModel != null) { StatementVM statement = new StatementVM(statementModel); InitConstruct(statement); constructModels.Add(statementModel); constructs.Add(statement); continue; } IfThenElse ifThenElseModel = controlConstructScheme.FindIfThenElse(id); if (ifThenElseModel != null) { IfThenElseVM ifThenElse = new IfThenElseVM(ifThenElseModel); InitConstruct(ifThenElse); constructModels.Add(ifThenElseModel); constructs.Add(ifThenElse); } } List<QuestionConstructVM> questionConstructs = QuestionConstructs; foreach (ConstructVM construct in constructs) { if (construct is IfThenElseVM) { IfThenElseVM ifThenElse = (IfThenElseVM)construct; ifThenElse.ThenConstructs = ThenConstructs; } } modelSyncher = new ModelSyncher<ConstructVM, IConstruct>(this, constructs, constructModels); InitTitle(); }
public void Init(BookRelation fromRelation) { foreach (BookRelation relationModel in Book.BookRelations) { BookRelationVM relation = CreateRelation(relationModel); bookRelations.Add(relation); } if (fromRelation != null && FindExistRelation(fromRelation) == null) { Book.BookRelations.Add(fromRelation); bookRelations.Add(CreateRelation(fromRelation)); } modelSyncher = new ModelSyncher<BookRelationVM, BookRelation>(this, bookRelations, Book.BookRelations); }