![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Unfortunately, when I pass in <object>.GetType() as an argument rather than <object>, I get back a different set of proeprty descriptors; I get a lot of extra ones that I don't need. The reason this happens is because I'm implementing ICustomTypeDescriptor on my root control (and most of my other controls) to filter the set of properties exposed. So, using <object>.GetType() as the argument will not work for me; if I used it, I would be serializing properties I don't want serialized. ![]() |
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |