开发者

How do I comment a publicly visible type Enum?

How do I comment this Enum so that 开发者_如何学Pythonthe warning does not appear? Yes I realize that comments are unnecessary, but if commenting is easy and it resolves the warnings then I'd like to do it.

Warnings that appear: Missing XML comment for publicly visible type or member

/// <summary>
/// Conditional statements
/// </summary>
public enum ConditionType
{
    Equal,
    NotEqual,
    GreaterThan,
    GreaterThanOrEqual,
    LessThan,
    LessThanOrEqual
}


Like this:

/// <summary>
/// Conditional statements
/// </summary>
public enum ConditionType
{
    ///<summary>A == B</summary>
    Equal,
    ///<summary>A != B</summary>
    NotEqual,
    ///<summary>A > B</summary>
    GreaterThan,
    ///<summary>A >= B</summary>
    GreaterThanOrEqual,
    ///<summary>A < B</summary>
    LessThan,
    ///<summary>A <= B</summary>
    LessThanOrEqual
}

(Yes, this can get very tedious)

You may want to use different texts in the comments.

By the way. your enum should actually be called ComparisonType.


Comment each member:

/// <summary>
/// Conditional statements
/// </summary>
public enum ConditionType
{
    /// <summary>
    /// Tests for equality
    /// </summary>
    Equal,
    /// <summary>
    /// Tests for inequality
    /// </summary>
    NotEqual,
    // etc..
}

You may also want to check out GhostDoc for easy commenting

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜