The pattern can consist of optional white space and an asterisk ( *), followed by more optional white space. Otherwise, the text on the line up to the */ delimiter is processed as part of the comment.įor the lines after the one that begins with the /** delimiter, the compiler looks for a common pattern at the beginning of each line. On the line that contains the */ delimiter, if there's only white space up to the */ delimiter, that line is ignored. Otherwise, the entire text of the line after the /** delimiter is processed as part of the comment. If the first character after the /** delimiter is white space, that white-space character is ignored and the rest of the line is processed. On the line that contains the /** delimiter, if the rest of the line is white space, the line isn't processed for comments. /** */ Multiline delimiters: The /** */ delimiters have the following formatting rules:.You can turn this feature on or off in the Options dialog box. Visual Studio automatically inserts the and tags and positions your cursor within these tags after you type the /// delimiter in the code editor. If there's white space following the delimiter, it isn't included in the XML output. /// Single-line delimiter: The documentation examples and C# project templates use this form.You use the following delimiters with the XML documentation tags: The use of XML doc comments requires delimiters that indicate where a documentation comment begins and ends. When this option is enabled, the compiler generates the CS1591 warning for any publicly visible member declared in your project without XML documentation comments. You set either the GenerateDocumentationFile or DocumentationFile option, and the compiler will find all comment fields with XML tags in the source code and create an XML documentation file from those comments. / This class performs an important function. The comment fields include XML elements that describe the code block that follows the comments. You create documentation for your code by writing special comment fields indicated by triple slashes. Tags validated by the C# compiler and Visual Studio.Documentation comments and XML file generation.Tools like Visual Studio provide IntelliSense for many common XML elements used in documentation comments. Tools that process the XML documentation files can define XML elements and attributes specific to those tools.The C# compiler verifies that the comments match the API signatures for relevant tags.The C# compiler combines the structure of the C# code with the text of the comments into a single XML document.This process provides many advantages for you to add API documentation in your code: Other tools can process that XML output to create human-readable documentation in the form of web pages or PDF files, for example. The C# compiler produces an XML file that contains structured data representing the comments and the API signatures. C# source files can have structured comments that produce API documentation for the types defined in those files.
0 Comments
Leave a Reply. |