Пример #1
0
        /// <summary>
        /// Generates an attribute from its XML representation.
        /// </summary>
        /// <param name="reader"></param>
        private static void AddDeserializedAttribute(DDAttributesCollection ac, XmlReader reader)
        {
            var name = reader.GetAttribute(DDSchema.XML_SERIALIZE_ATTRIBUTE_NAME);
            var t    = reader.GetAttribute(DDSchema.XML_SERIALIZE_ATTRIBUTE_TYPE);

            if (name != null)
            {
                DDValue v = null;
                if (t != null)
                {
                    v = DDValueSxe.Deserialize(reader);
                }
                ac.Add(name, v);
            }

            if ((name == null) || (t == null)) // reads and close empty node
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    reader.ReadStartElement();
                }
                if (reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();                                            // need to close the opened element
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Generates an object from its XML representation.
 /// </summary>
 /// <param name="reader"></param>
 public virtual void ReadXml(XmlReader reader)
 {
     this.v = DDValueSxe.Deserialize(reader);
 }