How do I comment this Enum so that the 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
}
Enum is a reference type, but any specific enum type is a value type. In the same way, System. ValueType is a reference type, but all types inheriting from it (other than System. Enum ) are value types.
Enums in C# The enum keyword in C# declares a list of named integer constants. An enum can be defined in a namespace, structure or class. However, it is better to define it in a namespace so that all the classes can access it.
In C#, an enum (or enumeration type) is used to assign constant names to a group of numeric integer values. It makes constant values more readable, for example, WeekDays. Monday is more readable then number 0 when referring to the day in a week.
By definition, the enumeration member values are unique. However, you can create different member names with the same values.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With