gpt4 book ai didi

c# - 如何将默认 PropertyDescriptor 设置为属性?

转载 作者:太空宇宙 更新时间:2023-11-03 14:34:49 24 4
gpt4 key购买 nike

是否有用于为属性设置默认 PropertyDescriptor 的属性?我只想给属性添加一个属性并指定 PropertyDescriptor。然后将创建 PropertyDescriptor 的实例。我还没有在 .net 框架中找到该属性。

最佳答案

不,你不能。但是,您可以实现 ICustomTypeDescriptor或者(更容易)继承自 CustomTypeDescriptor .

如果您的对象包含在一个集合中,您可以使该集合实现 ITypedList相反。

关于c# - 如何将默认 PropertyDescriptor 设置为属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1476915/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com