views:

125

answers:

1

I'm puzzled by this. From the documentation...

A String containing the string value "true" to indicate that shadow copying is turned on; or "false" to indicate that shadow copying is turned off.

And its been this way since 1.1...can anyone shed any light?

EDIT: So I reflector'd the Getter and Setter for good measure...

public string ShadowCopyFiles
{
    get
    {
        return this.Value[8];
    }
    set
    {
        if ((value != null) && (string.Compare(value, "true", StringComparison.OrdinalIgnoreCase) == 0))
        {
            this.Value[8] = value;
        }
        else
        {
            this.Value[8] = null;
        }
    }
}

//The referenced Value property...

internal string[] Value
{
    get
    {
        if (this._Entries == null)
        {
            this._Entries = new string[0x10];
        }
        return this._Entries;
    }
}

private string[] _Entries;

So maybe the Value array begets an easier copy constructor or something?

+1  A: 

Lack of caffeine. Somethings are not meant to be understood.

This clearly seems to be a mistake from .NET first version, not fixed because that could break "legacy" code.

EDIT: Gosh, I just found this:

Thanks for your feedback on the .NET Framework! We agree that this is an oversight and that the property type should be a boolean. However, it is quite difficult (if not impossible) to make this change in a backwards compatible release (such as Orcas), because we would break the code of any customer relying on string comparisons. So unfortunately we must weigh the risk of breaking compatibility vs. the benefits of API cleanliness...and when it comes to best supporting our customer base, the former typically wins. We will track this internally as a good thing to improve and we'll continue to consider it in future releases.

From here

Rubens Farias
Nice find. I guess 4.0 is supposed to be backward compatible too...because it's still a string...
Jason Punyon
I don't think this will change someday...
Rubens Farias