在C#中有属性影响显示类如何智能感知成员? [英] Are there attributes in C# for affecting how Intellisense displays class members?

查看:261
本文介绍了在C#中有属性影响显示类如何智能感知成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何C#的属性,我可以适用于类成员,改变他们出现在智能感知列表的方式吗?这突然出现在我的脑海,当我建设有许多静态常量一类,我(简单!)希望它看起来像智能感知枚举。

Are there any C# attributes that I can apply to class members, to change the way they appear in the Intellisense listings? This popped into my head when I was building a class with many static constants, and I (briefly!) wanted it to look like an enumeration in Intellisense.

是的,这是。傻

但它让我想起了 - 的有什么办法一些疯狂的程序员可以使一个类成员在智能感知出现不同? ?制作领域的样子性质等

But it got me thinking - is there any way some crazy programmer can make a class members appear differently in the Intellisense? Make fields look like properties, etc?

例如,有个过时属性:

[Obsolete("Stop using this. Really. It's old.")]
public int VariableThatIsReallyOld;



哪个前缀字 [过时] VariableThatIsReallyOld 的说明。

推荐答案

有描述的DebuggerDisplay属性<一个HREF =http://stackoverflow.com/questions/471241/can-i-customize-the-intellisense-value-shown-when-hovering-while-debugging-in-vis>这里。

There's the DebuggerDisplay attribute described here.

这篇关于在C#中有属性影响显示类如何智能感知成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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