Пример #1
0
        public AbstractFormVM(StudyUnitVM studyUnit)
            : base(studyUnit)
        {
            abstractModel = studyUnit.AbstractModel;
            this.IsIgnoreValidation = true;

            books = new ObservableCollection<BookVM>();
        }
Пример #2
0
        public static void CreateAbstract(XElement studyUnitElem, StudyUnit studyUnit)
        {
            ///// タイトル
            Abstract abstractModel = new Abstract();
            XElement citationElem = studyUnitElem.Element(r + TAG_CITATION);
            if (citationElem == null)
            {
                return;
            }
            XElement titleElement = citationElem.Element(r + TAG_TITLE);
            if (titleElement == null)
            {
                return;
            }
            abstractModel.Title = titleElement.Value;

            ///// 概要
            XElement abstractElem = studyUnitElem.Element(s + TAG_ABSTRACT);
            if (abstractElem == null)
            {
                return;
            }
            XAttribute summaryIdAttr = abstractElem.Attribute(ATTR_ID);
            if (summaryIdAttr == null)
            {
                return;
            }
            XElement contentElem = abstractElem.Element(r + TAG_CONTENT);
            if (contentElem == null)
            {
                return;
            }
            abstractModel.SummaryId = summaryIdAttr.Value;
            abstractModel.Summary = contentElem.Value;

            ///// 目的
            XElement purposeElem = studyUnitElem.Element(s + TAG_PURPOSE);
            if (purposeElem == null)
            {
                return;
            }
            XAttribute purposeIdAttr = purposeElem.Attribute(ATTR_ID);
            if (purposeIdAttr == null)
            {
                return;
            }
            contentElem = purposeElem.Element(r + TAG_CONTENT);
            if (contentElem == null)
            {
                return;
            }
            abstractModel.PurposeId = purposeIdAttr.Value;
            abstractModel.Purpose = contentElem.Value;
            studyUnit.Abstract = abstractModel;
        }
Пример #3
0
        private static void CreateAbstract(XElement codebookElem, StudyUnit studyUnit)
        {
            XElement stdyDscrElem = codebookElem.Element(cb + TAG_STDY_DSCR);
            if (stdyDscrElem == null)
            {
                return;
            }

            Abstract abstractModel = new Abstract();
            XElement citationElem = stdyDscrElem.Element(cb + TAG_CITATION);
            if (citationElem != null)
            {
                XElement titlElem = citationElem.Descendants(cb + TAG_TITL).FirstOrDefault();
                if (titlElem != null)
                {
                    abstractModel.Title = titlElem.Value;
                }
            }

            XElement stdyInfoElem = stdyDscrElem.Element(cb + TAG_STDY_INFO);
            if (stdyInfoElem != null)
            {
                abstractModel.Summary = (string)stdyInfoElem.Element(cb + TAG_ABSTRACT);
            }

            studyUnit.Abstract = abstractModel;
        }