/// <summary>
        /// Populates this <see cref="FamilyHistoryCondition"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the family history condition data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a family history condition node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("family-history-condition");

            Validator.ThrowInvalidIfNull(itemNav, Resources.FamilyHistoryConditionUnexpectedNode);

            _relativeCondition = new ConditionEntry();
            _relativeCondition.ParseXml(itemNav.SelectSingleNode("condition"));
        }
コード例 #2
0
        /// <summary>
        /// Populates this <see cref="FamilyHistoryV3"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the family history data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a family history node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("family-history");

            Validator.ThrowInvalidIfNull(itemNav, Resources.FamilyHistoryUnexpectedNode);

            _conditions.Clear();
            foreach (XPathNavigator conditionNav in itemNav.Select("condition"))
            {
                ConditionEntry condition = new ConditionEntry();
                condition.ParseXml(conditionNav);
                _conditions.Add(condition);
            }

            _relative =
                XPathHelper.GetOptNavValue <FamilyHistoryRelativeV3>(itemNav, "relative");
        }