为什么 AppDomainSetup.ShadowCopyFiles 是一个字符串?
来自文档:
包含字符串值“true”的字符串,表示卷影复制已打开;或“false”表示卷影复制已关闭。
从 1.1 开始就是这样。任何人都可以阐明吗?
为了更好地衡量,我对 getter 和 setter 进行了反射:
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;
所以也许 Value
数组会产生一个更简单的复制构造函数或其他东西?
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?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
缺乏咖啡因。有些事情是不应该被理解的。
这显然似乎是 .NET 第一个版本中的错误,未修复,因为这可能会破坏“遗留”代码。
天哪,我刚刚发现了这个:
来自此处
Lack of caffeine. Some things 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.
Gosh, I just found this:
From here