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
Post a Comment