What tags can I use for putting code examples in .NET ///
XML comments?
The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags.
To insert XML comments for a code element Do one of the following: Type /// in C#, or ''' in Visual Basic. From the Edit menu, choose IntelliSense > Insert Comment. From the right-click or context menu on or just above the code element, choose Snippet > Insert Comment.
C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.
The use of XML doc comments requires delimiters that indicate where a documentation comment begins and ends. You use the following delimiters with the XML documentation tags: /// Single-line delimiter: The documentation examples and C# project templates use this form.
Try using the <example>
tag.
/// <example>
/// <code>
/// // create the class that does translations
/// GiveHelpTransforms ght = new GiveHelpTransforms();
/// // have it load our XML into the SourceXML property
/// ght.LoadXMLFromFile(
/// "E:\\Inetpub\\wwwroot\\GiveHelp\\GiveHelpDoc.xml");
/// </code>
/// </example>
I got the above example from here.
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