C# ICustomTypeDescriptor.GetDefaultProperty的含义是什么
在实现C# ICustomTypeDescriptor.GetDefaultProperty的含义是什么,c#,.net,C#,.net,在实现ICustomTypeDescriptor时,我偶然发现了GetDefaultProperty方法。我刚刚实现了使用TypeDescriptor.GetDefaultProperty,然后我想知道:我实际上不知道这个方法的预期用途是什么。我猜一个人最有可能首先编辑的属性,比如TextBox.Text,但我似乎无法证实这一点 在这方面没有任何帮助,声明: 返回此组件实例的默认属性 文档中说返回null是针对没有属性的对象。那么,如果我们为3d Box类创建一个ICustomTypeDescr
ICustomTypeDescriptor
时,我偶然发现了GetDefaultProperty
方法。我刚刚实现了使用TypeDescriptor.GetDefaultProperty
,然后我想知道:我实际上不知道这个方法的预期用途是什么。我猜一个人最有可能首先编辑的属性,比如TextBox.Text
,但我似乎无法证实这一点
在这方面没有任何帮助,声明:
返回此组件实例的默认属性
文档中说返回null是针对没有属性的对象。那么,如果我们为3d Box类创建一个ICustomTypeDescriptor,大致如下:
public class Box {
public double Length { get; set; }
public double Width { get; set; }
public double Height { get; set; }
}
我应该使用什么财产