【发布时间】:2010-04-01 17:22:16
【问题描述】:
我知道component-model通过PropertyDescriptor的ShouldSerializeValue方法表示一个属性是否有默认值。
基本的 windows-forms Control 类,有一些属性,如 ForeColor、BackColor 和 Font,默认为与父级相同的值,但我找不到任何 TypeDescriptor 或PropertyDescriptor 提供这些默认值。 Control 类没有实现 ICustomTypeDescriptor,也没有 TypeDescriptionProviderAttribute。
Control 类如何指示这些属性是否应该被序列化? 它在哪里提供这些属性的 PropertyDescriptors??
谢谢!!!
【问题讨论】:
标签: controls winforms propertydescriptor system.componentmodel