c# - Control Xml Serialization of List<Object> -


assuming following xml structure:

<root>     <element>...</element>        <element>...</element>     <anotherelement>...</anotherelement> </root> 

i deserializing xml elements of type element list<elementtype> via following way:

[xmlelement("element")] public list<elementtype> elements { get; set; } 

so far good, need control objects of type elementtype serialize. should achieved checking objects' isenabled property. objects isenabled = true should serialized. property not part of xml document can set via program's gui. far can see, shouldserialize[membername] won't trick in case.

initially, thinking using sort of adaptor property wanted see if there elegant way of achieving goal.

unfortunately, making changes xml structure not alternative.

thanks in advance, guys. appreciated. cheers, zettel.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -