Show/Hide Toolbars

XSharp

Navigation: X# Documentation > X# Programming guide

XML Documentation Comments

Scroll Prev Top Next More

In X#, you can create documentation for your code by including XML elements in special comment fields (indicated by triple slashes) in the source code directly before the code block to which the comments refer, for example.

 

/// <summary>
///  This class performs an important function.
/// </summary>
CLASS MyClass
.
.
END CLASS

When you compile with the -doc option, the compiler will search for all XML tags in the source code and create an XML documentation file. To create the final documentation based on the compiler-generated file, you can create a custom tool or use a tool such Sandcastle.

 

To refer to XML elements (for example, your function processes specific XML elements that you want to describe in an XML documentation comment), you can use the standard quoting mechanism (< and >). To refer to generic identifiers in code reference (cref) elements, you can use either the escape characters (for example, cref="List<T>") or braces (cref="List{T}"). As a special case, the compiler parses the braces as angle brackets to make the documentation comment less cumbersome to author when referring to generic identifiers.

 

Since we use the same documentation engine that C# does, we refer to the C# documentation for the list of allowed documentation tags.