3

似乎并非所有 Xml 注释都显示在 Intellisense 中,但也许我做得不对?无论如何,我正在努力使枚举列表中的各个枚举成员以智能感知方式显示并带有描述性文本。例如,在 String.Split 方法中,第三个重载将 StringSplitOptions 枚举作为参数,如下所示:

替代文字 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
...

上面的示例确实有效,但仅适用于第一个枚举,而不适用于其他任何枚举。

我做错了什么?

4

1 回答 1

3

你有正确的想法,但你的逗号位置搞砸了。要显示单个枚举,请将它们放在逗号之后,而不是之前。在这些情况下,您可能希望将逗号放在每行的末尾而不是开头。

例如

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 
... 
于 2010-02-11T22:47:49.403 回答