如何使 VS 2008 中的 Xml 注释与 Intellisense 一起进行枚举?
看来并不是所有的 Xml 注释都会出现在 Intellisense 中,但也许我做得不正确?无论如何,我正在尝试使枚举列表中的各个枚举成员显示在带有描述性文本的智能感知中。例如,在 String.Split 方法中,第三个重载采用 StringSplitOptions 枚举作为参数,如下所示:
alt text http://www.freeimagehosting.net/uploads/a138d36615.jpg
在我尝试过的其他事情中:
public enum ErrorTypeEnum
{
/// <summary>The process could not identify an agency </summary>
BatchAgencyIdentification // Couldn't identify agency
/// <summary>The batch document category was invalid.</summary>
, BatchInvalidBatDocCatCode // Anything other than "C"
/// <summary>The batch has no documents.</summary>
, BatchHasNoDocuments // No document nodes
...
上面的示例确实有效,但仅适用于第一个枚举,不适用于任何其他枚举。
我做错了什么?
It appears that not all Xml-Commenting shows up in Intellisense, but perhaps I am not doing it correctly? Anyway, I am trying to make it so that individual enumeration members in an enumeration list show up in intellisense with descriptive text. For example, in the String.Split method, the third overload takes the StringSplitOptions enumeration as a parameter, as shown here:
alt text http://www.freeimagehosting.net/uploads/a138d36615.jpg
Among the other things I've tried:
public enum ErrorTypeEnum
{
/// <summary>The process could not identify an agency </summary>
BatchAgencyIdentification // Couldn't identify agency
/// <summary>The batch document category was invalid.</summary>
, BatchInvalidBatDocCatCode // Anything other than "C"
/// <summary>The batch has no documents.</summary>
, BatchHasNoDocuments // No document nodes
...
The example above DOES work, but only for the first enumeration, not any others.
What I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的想法是正确的,但你的逗号位置把它搞砸了。要显示各个枚举,请将它们放在逗号之后,而不是之前。在这些情况下,您可能需要将逗号放在每行的末尾而不是开头。
例如
You've got the right idea, but your comma placement is screwing it up. To get showing up for the individual enums, place them AFTER the commas, not before. You might want to put your commas at the end of each line instead of the beginning in these cases.
e.g.