Re: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor
- From: "Sergey M" <no@xxxxxxxx>
- Date: Thu, 1 Mar 2007 13:01:13 -0500
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/
.
- References:
- Prev by Date: Adding attributes to properties or fields at design time.
- Next by Date: How do I set DesignerSerializationVisibility on inherited properties?
- Previous by thread: Re: InheritedPropertyDescriptor vs. ReflectedPropertyDescriptor
- Next by thread: Adding attributes to properties or fields at design time.
- Index(es):
Relevant Pages
|