public CustomHealthTypeWrapper( HealthRecordItemCustomBase wrappedInstance) : base(new Guid(ApplicationCustomTypeID)) { m_wrappedObject = wrappedInstance; // Test for null here because the deserialization code // needs to create this object first... if (wrappedInstance != null) { wrappedInstance.Wrapper = this; } m_when = new HealthServiceDateTime(); }
protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator navigator = typeSpecificXml.CreateNavigator(); navigator = navigator.SelectSingleNode("app-specific"); if (navigator == null) { throw new ArgumentNullException("null navigator"); } XPathNavigator when = navigator.SelectSingleNode( "when"); m_when = new HealthServiceDateTime(); m_when.ParseXml(when); XPathNavigator formatAppid = navigator.SelectSingleNode("format-appid"); string appid = formatAppid.Value; XPathNavigator formatTag = navigator.SelectSingleNode("format-tag"); string wrappedTypeName = formatTag.Value; if (wrappedTypeName != NullObjectTypeName) { m_wrappedObject = (HealthRecordItemCustomBase) CreateObjectByName(wrappedTypeName); if (m_wrappedObject != null) { m_wrappedObject.Wrapper = this; XPathNavigator customType = navigator.SelectSingleNode("CustomType"); if (customType != null) { m_wrappedObject.ParseXml(customType); } } } }