I have one class which was serialized before. We have the xml output from it. When we open the project we deserialize the xml to get the preserved objects. Now i have added new bool property to class and since it is a new property, old xmls don't have this attribute. My deserialization works fine but assigns false to bool property, I want it to set true if its not there in XML. How can i achieve this ? I tried like this
public bool? _flag;
[XmlElement("Flag")]
public bool? flag
{
get
{
if (null != _flag)
{
return _flag;
}
return true;
}
set { _flag= value; }
}