Notre Poubelle
2007-03-01 00:58:00 UTC
Hello,
I wonder if anyone can explain the difference between
InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor classes? I'm
writing my own designer based on the .NET design time framework. I've got a
custom design surface and am performing custom serialization with my own
designer loader.
Most everything works properly except in some cases where serialization is
concerned, some properties of controls do not get serialized. I call the
property descriptor's ShouldSerializeValue method to help decide whether a
control property should be serialized. In some cases, this method returns
True and in other cases False, when I would not expect it to return False.
I've read the description of PropertyDescriptor.ShouldSerializeValue and I
think I understand the rules that shoud be applied.
I get a list of properties by calling
TypeDescritpor.GetPRoperties(<object>,false). I've noticed in some cases my
properties are of type InheritedPropertyDescriptor while in other cases, they
are of type ReflectedPropertyDescriptor. It is when the properties are of
type InheritedPropertyDescriptor that the call to ShouldSerializeValue
returns False when I don't expect it to. Why do I sometimes get
InheritedPropertyDescriptor and other times get ReflectedPropertyDescriptor?
The rules seem to be different between the two classes...
Thanks,
Notre
I wonder if anyone can explain the difference between
InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor classes? I'm
writing my own designer based on the .NET design time framework. I've got a
custom design surface and am performing custom serialization with my own
designer loader.
Most everything works properly except in some cases where serialization is
concerned, some properties of controls do not get serialized. I call the
property descriptor's ShouldSerializeValue method to help decide whether a
control property should be serialized. In some cases, this method returns
True and in other cases False, when I would not expect it to return False.
I've read the description of PropertyDescriptor.ShouldSerializeValue and I
think I understand the rules that shoud be applied.
I get a list of properties by calling
TypeDescritpor.GetPRoperties(<object>,false). I've noticed in some cases my
properties are of type InheritedPropertyDescriptor while in other cases, they
are of type ReflectedPropertyDescriptor. It is when the properties are of
type InheritedPropertyDescriptor that the call to ShouldSerializeValue
returns False when I don't expect it to. Why do I sometimes get
InheritedPropertyDescriptor and other times get ReflectedPropertyDescriptor?
The rules seem to be different between the two classes...
Thanks,
Notre