I have a class used to serialize and deserialize via XMLSerializer. ExportSteps is another class which implements IXmlSerializer for custom serialization.
My issue is it's not reading and setting any properties after it reads exportSteps. If I move IsNew and Test2 above Steps, it works fine. I don't think that is a valid solution though, what if I need two custom serialized classes?
public class PublishOptions
{
[XmlElement( "test" )]
public bool Test { get; set; }
[XmlElement( "exportSteps" )]
public ExportSteps Steps { get; set; } <-- implements IXmlSerializable
[XmlElement( "isNew" )]
public bool IsNew { get; set; }
[XmlElement( "test2" )]
public bool Test2{ get; set; }}
}
var test = serializer.Deserialize(stream) as PublishOptions;
XML (Example):
<publishingOptions>
<test>true</test>
<exportSteps>
<option>foo</option>
<option>bar</option>
</exportSteps>
<isNew>true</isNew>
<test2>true</test2>
</publishingOptions>