如何将默认的PropertyDescriptor设置为属性?

发布于 2024-08-06 00:07:27 字数 125 浏览 1 评论 0原文

是否有用于设置属性默认 PropertyDescriptor 的属性?我只想向属性添加属性并指定 PropertyDescriptor。然后 PropertyDescriptor 的实例就被创建了。 我在.net框架中没有找到该属性。

Are there an attribute for setting default PropertyDescriptor for a property? I just want to add a attribute to a property and specify PropertyDescriptor. And then the instance of the PropertyDescriptor would have been created.
I haven't found the attribute in .net framework.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲸落 2024-08-13 00:07:27

不,你不能。但是,您可以实现 ICustomTypeDescriptor< /a> 或(更简单)继承 CustomTypeDescriptor< /代码>

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

No, you can't. However, you could implement ICustomTypeDescriptor or (easier) inherit from CustomTypeDescriptor.

If your objects are contained in a collection, you could make the collection implement ITypedList instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文