From: Christian on
Hi Edward,

i've got the same problem, is there still a solution?

Thanks
Christian



Edward Beach wrote:

Getting the Type Descriptor Provider at runtime
16-Dec-09

I have a implemented a custom TypeDescriptorProvider /
CustomTypeDescriptor solution for a custom type to display custom
properties when an instances of my custome type is selected by the
PropertyGrid.

To register the TypeDescriptionProvider for my type I use the
TypeDescripionProvider Attribute with my class:

[TypeDescriptionProvider(typeof(MyTypeDescriptionProvider))]

The MyTypeDescriptionProvider maintains a cache of PropertyDescriptors
that I need to refresh every so often so I need to get access to it
after it is been registered. I have tried to call the function

TypeDescriptor.GetProvider(typeof(MyType));

to get at my description provider but instead it gives me a
TypeDescriptionNode. So at runtime how can I get access to my custom
TypeDescriptorProvider?

This question has been asked before but unfortunately not answered
(http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/
0c88ff70-1b9f-4a6b-9977-cc4e70935e87)
Thanks!

Previous Posts In This Thread:

On Wednesday, December 16, 2009 8:25 AM
Edward Beach wrote:

Getting the Type Descriptor Provider at runtime
I have a implemented a custom TypeDescriptorProvider /
CustomTypeDescriptor solution for a custom type to display custom
properties when an instances of my custome type is selected by the
PropertyGrid.

To register the TypeDescriptionProvider for my type I use the
TypeDescripionProvider Attribute with my class:

[TypeDescriptionProvider(typeof(MyTypeDescriptionProvider))]

The MyTypeDescriptionProvider maintains a cache of PropertyDescriptors
that I need to refresh every so often so I need to get access to it
after it is been registered. I have tried to call the function

TypeDescriptor.GetProvider(typeof(MyType));

to get at my description provider but instead it gives me a
TypeDescriptionNode. So at runtime how can I get access to my custom
TypeDescriptorProvider?

This question has been asked before but unfortunately not answered
(http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/
0c88ff70-1b9f-4a6b-9977-cc4e70935e87)
Thanks!


Submitted via EggHeadCafe - Software Developer Portal of Choice
Book Review: ASP.NET 2.0 Web Programming with VB 2005 [Murach]
http://www.eggheadcafe.com/tutorials/aspnet/5ce13132-519c-486e-908d-b006d6c94b35/book-review-aspnet-20.aspx