Creating Enumerations of Items with a Certain Arbitrary Data Type
.NET does not allow defining enumerations of arbitrary types. In some situations an enumeration of predefined values/objects is needed. The code below creates an enumeration of type String called ClipboardType. The design follows the pattern that is used in the .NET Framework class library, for example, for the Color type:
Usage:
IntelliSense support in Visual Studio 2005 similar to enumeration types is achieved by adding the completionlist XML comment to the class. The cref attribute takes the type whose shared members should be shown in the IntelliSense list. completionlist is undocumented but is treated correctly by the Visual Basic and C# compilers of Visual Studio 2005.