views:

51

answers:

1

I want to do this:

enum Foo
{
    [Display="Item One"]
    ItemOne,
}

So that Intellisense will display it like in the attribute instead of the actual name.

I know it's possible, I've seen it before.

+2  A: 

Well you could provide XML documentation:

enum Foo
{
    /// <summary>Item One</summary>
    ItemOne
}

I'm not sure whether that's quite what you were thinking of, but here's an example of what it looks like in VS 2010:

IntelliSense with enum

Note that I'm assuming you mean from the code editor... if you mean within a property editor, that could be something entirely different, e.g. DisplayNameAttribute (although that's meant for properties, events or methods).

If you know an example of what you want within the framework, we may be able to help more.

Jon Skeet
Thanks for the suggestion. Its not what I was originally after but I can make do.
rmx