EDIT Here is my solution, but please check out Mythz, as I am sure it will work.
I deserialise for the custom structure of MyBool , not bool .
Here is the code for the MyBool structure.
public struct MyBool { public bool Value { get; set; } public static MyBool Parse(string value) { return new MyBool {Value = (value == "1" || value=="true")}; } public override string ToString() { return Value.ToString(CultureInfo.InvariantCulture); } public static implicit operator bool(MyBool lValue) { return lValue.Value; }
and change Foo to:
public class Foo { public MyBool isWorking { get; set; } }
Criticism is welcome.
source share