all groups > dotnet windows forms designtime > january 2006 >
You're in the

dotnet windows forms designtime

group:

Retrieving the original component that extends a property in a converter


Retrieving the original component that extends a property in a converter Remus Rusanu [MSFT]
1/25/2006 1:50:43 AM
dotnet windows forms designtime:
I have a component that implements IExtenderProvider and add a property, say
"ID", to some controls, say a Button. I have added a type converter to this
property and this type converter offers a drop down list of possible values,
by overriding GetStandardValuesSupported and GetStandardValues. But in order
to populate the list of values, I need to get a reference to the my
component instance that provides the extended property. I don't see how can
I retrieve this from the ITypeDescriptorContext. The context is exposing the
'Button' that has the extended property, but no the component instance that
provides this extended property.

TIA,
~ Remus

Re: Retrieving the original component that extends a property in a converter Remus Rusanu [MSFT]
1/25/2006 7:09:17 PM
Found it. The Provider property on the ExtenderProvidedPropertyAttribute in
the Attributes collection of the context.PropertyDescriptor.

[quoted text, click to view]

Re: Retrieving the original component that extends a property in a converter Dira
1/27/2006 12:38:15 AM
O!
This is much better than the code i used:

Remus Rusanu [MSFT] schrieb:

[quoted text, click to view]
AddThis Social Bookmark Button