/****************************************************************************/ public virtual void SerializeProperty(cXMLWriter objWriter, object objInstance, PropertyInfo objProperty) { if (m_eAttributes != Attributes.DeserializeOnly) { string strElementName = this.ElementName; if (strElementName == "") { strElementName = objProperty.Name; } string strValue = objProperty.GetValue(objInstance, null).Normalized(); if (m_bForceType) { using (new XmlElementWriter(objWriter, strElementName)) { objWriter.WriteAttributeString("type", objProperty.PropertyType.ToString().ToLower().Replace("system.", "")); objWriter.WriteString(strValue); } } else { objWriter.WriteElementString(strElementName, strValue); } } }
/****************************************************************************/ public override void SerializeProperty(cXMLWriter objWriter, object objInstance, PropertyInfo objProperty) { IEnumerable aList = objProperty.GetValue(objInstance, null) as IEnumerable; using (XmlElementWriter w = new XmlElementWriter(objWriter, "List")) { objWriter.WriteAttributeString("name", this.ElementName); SerializeList(objWriter, aList); } }
/****************************************************************************/ public override void SerializeProperty(cXMLWriter objWriter, object objInstance, PropertyInfo objProperty) { if (m_eAttributes != Attributes.DeserializeOnly) { string strAttributeName = this.ElementName; if (strAttributeName == "") { strAttributeName = objProperty.Name; } string strValue = objProperty.GetValue(objInstance, null).Normalized(); objWriter.WriteAttributeString(strAttributeName, strValue); } }