/****************************************************************************/ 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) { IEnumerable aList = objProperty.GetValue(objInstance, null) as IEnumerable; if (this.ElementName != "") { using (XmlElementWriter w = new XmlElementWriter(objWriter, this.ElementName)) { SerializeList(objWriter, aList); } } else { SerializeList(objWriter, aList); } }
/****************************************************************************/ public static void Serialize(cXMLWriter objWriter, object objInstance, XmlSerialize objAttribute) { Type objType = objInstance.GetType(); string strElementName = objType.Name; if (objAttribute != null && objAttribute.ElementName != "") { strElementName = objAttribute.ElementName; } using (XmlElementWriter w = new XmlElementWriter(objWriter, strElementName)) { SerializeChildren(objWriter, objInstance); } return; }