I managed to work out how to do it in the end (by reading the N2 source). You use global resource files.
In particular, the code in EditableEnumAttribute
calls HttpContext.GetGlobalResourceObject
(by calling Utility.GetGlobalResourceString
) for each item in the enum.
So to have enum names with spaces (and other special characters) in them, you add a global resource file that matches the name of the enum, with an entry for each enum item that needs special characters.
The first thing you need to do is add an App_GlobalResources
folder to the top level of your project. This is vital, as if you use VS.NET to create resource files elsewhere they don't get created as global ones.
Next create a resource file in App_GlobalResources
that matches the name of the enum. It needs to match just the short name of the enum, not the full namespace prefixed name.
Now create an entry in the resource file for each enum item, with the enum item name in the Name
column and the name including the special characters in the Value
column. You don't need to add an entry for every enum item, only for the ones with special characters (though it would probably make sense to add them all).