Enum Type Import Definitions

To use enum types as the core types for type shortcuts, the designer has to know where to load the enum types from. It uses type imports files which define which assemblies contain enum types. After type import files are loaded, the enums are available in the Type Shortcuts of the project and you can define new type shortcuts based on them.

As all target frameworks support enum types directly, you don't need type converters to work with enum types: it's enough to import the enum types in the designer using type import files.

Location and file format

TypeImport files, with the extension .typeimports are small XML files which are stored in TypeConverter folders (either the default type converter folder of the designer or the additional type converter folder specified in the Project Settings) or in the folder from which the project was loaded.

The format is as follows:

<typeImports>
    <typeImport typeName="" assemblyFile=""/> 
</typeImports>

The XML is stored in .typeimports files which are all read at project load (at the same time when Type Converters are read from the same folder(s)). typeName is the name to use to obtain a Type instance using the System.Type .NET class. assemblyFile is the filename + full path, which points to an assembly to load which contains the type specified. If the type isn't an enum type, the type is ignored. If assemblyFile is omitted, the system will try to instantiate the type without the filename, e.g. through a type-lookup in the current appDomain.

Re-loading .typeimports files

If you have created a .typeimports file and you want to import its contents, you don't need to restart the designer. You can re-load the .typeimports files by right-clicking the project node in the Project Explorer, and select Re-scan for TypeConverters and .typeimports files from the context menu.

Check which types are loaded

To see which types are loaded, use from the main menu: Tools -> View Loaded External Types... This will show all loaded external types, including enum types. If your enum type isn't present, please check the Application Output Pane in the designer (docked at the bottom) to see whether an error occurred during type load.