I want to document the default value of an enum typed field:
/// <summary>
/// The default value is <see cref="Orientation.Horizontal" />.
/// </summary>
public Orientation BoxOrientation;
The compiler warns that it couldn't resolve the reference. Prefixing F: or M: silences the compiler, but E: also does, so I'm unsure what prefix is correct.
In C programming, an enumeration type (also called enum) is a data type that consists of integral constants. To define enums, the enum keyword is used. enum flag {const1, const2, ..., constN}; By default, const1 is 0, const2 is 1 and so on.
Enumeration is a user defined datatype in C language. It is used to assign names to the integral constants which makes a program easy to read and maintain. The keyword “enum” is used to declare an enumeration.
The enum type, introduced in Java 5, is a special data type that represents a group of constants. Using enums, we can define and use our constants in the way of type safety. It brings compile-time checking to the constants.
The prefixes F
, M
and E
are all valid and probably the reason that the compiler warning disappears.
You should however use the F
that refers to fields. For more information on how Visual Studio generates documentation identifiers see:
Processing the XML File (C# Programming Guide)
I don't think you should need the prefix - probably you need to add a "using" to the namespace where the Orientation
type is defined.
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