This project is read-only.
To set an explicit order for any properties/fields in a class when being written as elements you can simply decorate the properties/fields with either an XmlElement attribute or DataMember attribute. You may specify an order property for either of these attributes and DotSerialize will use that order when writing out the xml. Below is an example:
class User
{
   [XmlAttribute("name")] string Name { get; set; }
   [XmlIgnore] string Password { get; set; }
   [XmlElement("domain", 1)] string Domain { get; set; }
   [XmlAttribute("dept")] string Department { get; set; }   
   [XmlElement("background", 2)] string Background { get; set; }
}

Last edited Feb 2, 2015 at 2:20 AM by WiredWiz, version 2