views:

14

answers:

0

I have a class that is serialized to XML. Inside, I have a member:

private double? mDefaultMin = null;
protected double? DefaultMin
{
    get { return mDefaultMin; }
    set { mDefaultMin= value; }
}

Later on, I realize that I actually need to store list of values:

private DoubleList mDefaultMin = null;
protected DoubleList DefaultMin
{
    get { return mDefaultMin; }
    set { mDefaultMin= value; }
}

Where DoubleList is a class defined like this:

[Serializable]
public class DoubleList : List<double>
{ }

Now, of course, deserialization of the old objects fails. What's the best way to tell .NET to throw away the old object when deserializaing the object? I could leave the old member around (and unused) but I'd rather not have the legacy code in my class.