Exemplo n.º 1
0
        /****************************************************************************/
        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);
            }
        }
Exemplo n.º 2
0
        /****************************************************************************/
        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);
            }
        }
Exemplo n.º 3
0
        /****************************************************************************/
        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;
        }