Code specification C # comments

Source: Internet
Author: User
Tags xml xpath

Note:(Excerpted and used by yourself) understand a book --->. Net Design Specifications

In C,ProgramThere are three types of annotations.


Note: note is for the reader, not for the compiler or operating system to execute the command function.


Three Annotations:


1. // single line comment;




2 ./*


Multiple lines or comments






3. /// <summary>


/// This is a description of the class


/// </Summary>




/// <Summary>


/// This is a description of the method


/// </Summary>


/// <Param name = "ARGs"> </param>




InstructionsCodeFolding command


# Region this is the first piece of code






# Endregion


Annotation syntax


To useC# ProvidedXMLAnnotation function, your annotation should use special annotation syntax (///. In///Then, you can use pre-defined tags to annotate your code, or insert your own defined tags. The custom tag will be added to the generated annotation document later.


Predefined tags Usage

<C>Mark the text in the description as code

<Code>Provides a method to indicate multiple lines as code.

<Example>Example of using methods or other library members

<Exception>Allow you to specify possible exception classes

<Include>Allow you to reference the descriptionSource codeAnnotations in another file of type and member in,UseXML xpathSyntax to describe the types and members in your source code.

<List>DirectionXMLInsert a list in the annotation document

<Para>DirectionXMLInsert a paragraph in the comment document

<Param>Describe a parameter

<Paramref>Provides a method to indicate a word as a parameter.

<Permission>Allow you to add member access permissions to the document

<Remarks>Used to add information about a type

<Returns>Description Return Value

<See>Specified Link

<Seealso>Specify"See"Text in Section

<Summary>General description of type or type members

<Value>Description attribute


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.