Re: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor

Tech-Archive recommends: Fix windows errors by optimizing your registry



Notre,

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. :(

Yeah, I can see why that would be an issue for you. Take a look at
TypeDescriptor.GetProperties() overloads that take an array of Attribute as
a second parameter. I omitted that in my last reply but that's actually what
we use. Perhaps you could use that to filter out properties you don't want
to get serialized. It's been a while since I looked into that part of the
application, but if I recall it correctly, we use attributes filter to force
it to serialize extender properties. HTH.
--
Sergey Mishkovskiy
http://www.usysware.com/dpack/ - free VS add-ons
http://www.usysware.com/blog/


.



Relevant Pages