How do you desearialize a bool from Xml with custom true and false values?
Define another property that is hidden, which does the translation for you:
[XmlRoot(ElementName="response")]
public class Response()
{
[XmlElement(ElementName="result")]
private string ResultInternal { get; set; }
[XmlIgnore()]
public bool Result{
get{
return this.ResultInternal == "Success";
}
set{
this.ResultInternal = value ? "Success" : "Failed";
}
}
}