开发者

How to make Xml comments in VS 2008 work with Intellisense for enumerations?

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开发者_Python百科/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?


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.

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 
... 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜