你能解释一下“财产:”这个词是什么意思吗?
[property: NotifyParentProperty( true )]
public string Filename
{
get;
set;
}
你能解释一下“财产:”这个词是什么意思吗?
[property: NotifyParentProperty( true )]
public string Filename
{
get;
set;
}
这意味着将属性应用于属性。
在这种特定情况下,它是多余的,可以省略。
这种元素定义了属性目标,并且在目标可能不明确时最有用,例如目标method
和return
. Visual Studio 还使用作为许多项目模板一部分assembly
的目标生成属性。AssemblyInfo.cs
更多信息和可能的属性目标列表:
消除歧义属性目标 (MSDN)