C Sharp (programming Language) - XML Documentation System

XML Documentation System

C#'s documentation system is similar to Java's Javadoc, but based on XML. Two methods of documentation are currently supported by the C# compiler.

Single-line documentation comments, such as those commonly found in Visual Studio generated code, are indicated on a line beginning with ///.

public class Foo { /// A summary of the method. /// A description of the parameter. /// Remarks about the method. public static void Bar(int firstParam) {} }

Multi-line documentation comments, while defined in the version 1.0 language specification, were not supported until the .NET 1.1 release. These comments start with slash-asterisk-asterisk (/**) and end asterisk-slash (*/).

public class Foo { /** A summary of the method. * A description of the parameter. * Remarks about the method. */ public static void Bar(int firstParam) {} }

Note there are some stringent criteria regarding white space and XML documentation when using the slash/asterisk/asterisk (/**) technique.

This code block:

/** * * A summary of the method.*/

produces a different XML comment from this code block:

/** * A summary of the method.*/

Syntax for documentation comments and their XML markup is defined in a non-normative annex of the ECMA C# standard. The same standard also defines rules for processing of such comments, and their transformation to a plain XML document with precise rules for mapping of CLI identifiers to their related documentation elements. This allows any C# IDE or other development tool to find documentation for any symbol in the code in a certain well-defined way.

Read more about this topic:  C Sharp (programming Language)

Famous quotes containing the word system:

    Such is the remorseless progression of human society, shedding lives and souls as it goes on its way. It is an ocean into which men sink who have been cast out by the law and consigned, with help most cruelly withheld, to moral death. The sea is the pitiless social darkness into which the penal system casts those it has condemned, an unfathomable waste of misery. The human soul, lost in those depths, may become a corpse. Who shall revive it?
    Victor Hugo (1802–1885)