Force XML elements to match the class order when serializing?

You should be able to set the Order on the serialization attribute.

You should be able to set the Order on the serialization attribute: public class SerializableClass { XmlElement("Element.1", Order = 1) public List Element1 { get { return _Element1; } set { _Element1 = value; } } private List _Element1; XmlElement("Element.2", Order = 2) public int Element2; XmlElement("Element.3", Order = 3) public List Element3 { get { return _Element3; } set { _Element3 = value; } } private List _Element3; XmlElement("Element.4", Order = 4) public string Element4; XmlElement("Element.5", Order = 5) public bool Element5; }.

Thanks Marc, much appreciated. I also found out that making all members properties rather than mixing them also seemed to have the desired effect. – Ryall Sep 8 '09 at 13:50.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions