[Mono-list] TypeInitializationException in ComponentModel
Robert Jordan
robertj at gmx.net
Mon Oct 22 19:28:13 EDT 2007
Andrus wrote:
> I need to add properties to type at runtime.
> There are two possibilities:
>
> 1. Use TypeDescriptor
> 2. Use dynamic compiling and dynamic assembly loading
>
> As I understand from replies, TypeDescriptor will not implemented in
> foreseeable future. I'm not capable to implement it.
No one said that "TypeDescriptor" will not be implemented.
Actually, only parts of the 2.0 profile are not implemented,
namely those related to "TypeDescriptionProvider".
> So I should go to dynamic compiling route, right ?
TypeDescriptors and properties added to types at
runtime are highly unrelated features. You don't really
add properties to types using TypeDescriptors. Properties
added this way are only visible to UI Designers and other
components that explicitly deal with TypeDescriptors (like
PropertyGrid, IIRC).
If you really meant this kind of extension, you could
implement ICustomTypeDescriptor. It's slightly more work
than using the new TypeDescriptionProvider, but it's at
least possible.
Robert
More information about the Mono-list
mailing list