枚举智能感知显示属性? [英] Enum Intellisense Display Attribute?

查看:154
本文介绍了枚举智能感知显示属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这样做:

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.

推荐答案

那么你可以提供XML文档:

Well you could provide XML documentation:

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

我不知道这是否是完全是自己所想的,但这里的是什么,它​​看起来像在VS 2010中的一个例子:

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:

请注意,我假设你从code主编的意思是......如果你在一个属性编辑器的意思是,这可能是完全不同的东西,例如: <一href="http://msdn.microsoft.com/en-us/library/system.componentmodel.displaynameattribute.aspx"><$c$c>DisplayNameAttribute (尽管这意味着属性,事件或方法)。

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.

这篇关于枚举智能感知显示属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆