Esempio n. 1
0
 /// <summary>
 /// Serializes the specified DDAttributesCollection into its XML representation and writes to a XML writer.
 /// The parent node must exist, for example, use IXmlSerializable interface
 /// </summary>
 /// <param name="n">the attributes collection to serialize</param>
 /// <param name="writer">XML writer used to write the XML document.</param>
 internal static void XMLSerialize(DDAttributesCollection ac, XmlWriter writer)
 {
     if (ac == null)
     {
         return;             // if attributes is null
     }
     foreach (var a in ac)
     {
         writer.WriteStartElement(DDSchema.XML_SERIALIZE_NODE_ATTRIBUTE);
         writer.WriteAttributeString(DDSchema.XML_SERIALIZE_ATTRIBUTE_NAME, a.Key);
         if (a.Value != null)
         {
             DDValueSxe.XMLSerialize(a.Value, writer);
         }
         writer.WriteEndElement();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Converts an object into its XML representation.
 /// </summary>
 /// <param name="writer"></param>
 public virtual void WriteXml(XmlWriter writer)
 {
     DDValueSxe.XMLSerialize(v, writer);
 }