public void BeginEdit() { if (inEdit) { return; } inEdit = true; bakKeyword = keyword.Clone() as Keyword; }
public void EndEdit() { if (!inEdit) { return; } inEdit = false; bakKeyword = null; Memorize(); }
public static void CreateCoverage(XElement studyUnitElem, StudyUnit studyUnit) { XElement coverageElem = studyUnitElem.Element(r + TAG_COVERAGE); if (coverageElem == null) { return; } Coverage coverageModel = Coverage.CreateDefault(); XElement topicElem = coverageElem.Element(r + TAG_TOPICAL_COVERAGE); if (topicElem != null) { //調査のトピック IEnumerable<XElement> elements = topicElem.Elements(r + TAG_SUBJECT); List<string> labels = new List<string>(); foreach (XElement subjectElem in elements) { labels.Add(subjectElem.Value); } coverageModel.CheckTopics(labels); //キーワード elements = topicElem.Elements(r + TAG_KEYWORD); foreach (XElement keywordElem in elements) { Keyword keyword = new Keyword() { Content = keywordElem.Value }; coverageModel.Keywords.Add(keyword); } } //調査の日付 XElement temporalElem = coverageElem.Element(r + TAG_TEMPORAL_COVERAGE); if (temporalElem != null) { coverageModel.DateRange = ReadDateRange(temporalElem, r + TAG_REFERENCE_DATE); } //メモ XElement spatialElem = coverageElem.Element(r + TAG_SPATIAL_COVERAGE); if (spatialElem != null) { //カバーする地域のレベル Dictionary<string, string> labelDict = ReadGeographicStructureElems(studyUnitElem); List<string> checkLabels = new List<string>(); IEnumerable<XElement> elements = spatialElem.Elements(r + TAG_GEOGRAPHIC_STRUCTURE_REFERENCE); foreach (XElement refElem in elements) { string refId = (string)refElem.Element(r + TAG_ID); if (refId == null) { continue; } string code = IDUtils.ToCode(refId); if (code == null) { continue; } if (!labelDict.ContainsKey(refId)) { continue; } string label = labelDict[refId]; checkLabels.Add(label); } coverageModel.CheckAreas(checkLabels); //メモ string memo = (string)spatialElem.Element(r + TAG_DESCRIPTION); coverageModel.Memo = memo; } studyUnit.Coverage = coverageModel; }
public KeywordVM(Keyword keyword) { this.keyword = keyword; }
private static void CreateCoverage(XElement codebookElem, StudyUnit studyUnit) { XElement stdyDscrElem = codebookElem.Element(cb + TAG_STDY_DSCR); if (stdyDscrElem == null) { return; } //調査のトピック Coverage coverageModel = Coverage.CreateDefault(); XElement stdyInfoElem = stdyDscrElem.Element(cb + TAG_STDY_INFO); if (stdyInfoElem != null) { XElement subjectElem = stdyInfoElem.Element(cb + TAG_SUBJECT); if (subjectElem != null) { List<string> labels = new List<string>(); IEnumerable<XElement> topcClasElems = subjectElem.Elements(cb + TAG_TOPC_CLAS); foreach (XElement topcClasElem in topcClasElems) { labels.Add(topcClasElem.Value); } coverageModel.CheckTopics(labels); //キーワード IEnumerable<XElement> keywordElems = subjectElem.Elements(cb + TAG_KEYWORD); foreach (XElement keywordElem in keywordElems) { Keyword keyword = new Keyword() { Content = keywordElem.Value }; coverageModel.Keywords.Add(keyword); } } XElement sumDscrElem = stdyInfoElem.Element(cb + TAG_SUM_DSCR); if (sumDscrElem != null) { //カバーする時期 DateRange dateRange = ReadDateRange(sumDscrElem, cb + TAG_TIME_PRD); if (dateRange != null) { coverageModel.DateRange = dateRange; } //メモ coverageModel.Memo = (string)sumDscrElem.Element(cb + TAG_GEOG_COVER); } } studyUnit.Coverage = coverageModel; }