17

I have this enum:

/// <summary>
/// Accoun types enumeration
/// </summary>
public enum AcoountTypeTransaction
{
    [Description("Account type debit")]
    Debit = 0,
    [Description("Account type Credit")]
    Credit = 1
} 

I want to show descriptions on my intellisense, this is only a sample, i have many enums that must be explained. There is a way to do this

1 Answer 1

31

Using XML document comments In the same manner as you would for the enumeration declaration itself like this.

/// <summary>
/// Account types enumeration
/// </summary>
public enum AcoountTypeTransaction
{
    /// <summary>
    /// This is the Debug  constant.
    /// </summary>
    [Description("Account type debit")]
    Debit = 0,
    /// <summary>
    /// This is the Credit constant.
    /// </summary>
    [Description("Account type Credit")]
    Credit = 1
} 

Result

1
  • So simple, I'm was trying it, but putting Sumary directly over the enum member Tks a lot. Commented Oct 23, 2013 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.