Possible Duplicate:
dynamic enum in C#
I don't know if this is theoretically possible.
I want to create a custom control, but one of the properties editable via the Visual Studio designer (an enumeration) is dynamic.
The purpose being I have different projects that, via a seperate editor I've written, export a project-specific enumeration, and would like to create a widget that supports different projects dynamically.
I.E.
class Widget : Panel
{
//**********This bit to be dynamic*****************
private EnumThatIdLikeToBeDynamic dynamicEnum = 0;
public EnumThatIdLikeToBeDynamic DynamicEnum
{
get { return dynamicEnum ; }
set { dynamicEnum = value; }
}
//*************************************************
public ItemWidget()
{
}
//Etc
}
My only solution I can see at the moment is to export the widget on a per-project basis from the tool that exports the enumeration.
Is there any way to achieve this with only a single widget?
P.s. it HAS to be an enumeration. Using an integer type and casting outside of the widget is not acceptable.