C # annotation label

Source: Internet
Author: User
Tags xml xpath

Document comment

This type of annotation uses.. Net has defined Xml labels for marking. This class of annotations should be used to declare interfaces, classes, methods, attributes, and fields so that code documents can be directly generated after the code is complete, let others better understand the code implementation and interfaces. For example


/// <Summary> MyMethod is a method in the MyClass class.

/// <Para> Here's how you cocould make a second paragraph in a description.

/// <See cref = "System. Console. WriteLine"/>

/// For information about output statements.

/// </Para>

/// <Seealso cref = "MyClass. Main"/>

/// </Summary>

Public static void MyMethod (int Int1)

{

}

Single line comment (Omitted ...)

Annotation label *


Tag
Function Usage
<Param>

<Param name = 'name'> description </param>

Name is the method parameter name. Enclose the name in single quotes ('').

It should be used in the annotation of the method declaration to describe a parameter of the method.
<See>

<See cref = "member"/>

Cref = "member" refers to the member or field that can be called through the current compilation environment. After the compiler checks that a given code element exists, it passes the member to the element name in the output XML. Member must be enclosed in double quotation marks.

Allows you to specify links from the text
<Seealso>

<Seealso cref = "member"/>


Cref = "member" refers to the member or field that can be called through the current compilation environment. After the compiler checks that a given code element exists, it passes the member to the element name in the output XML. Member must be enclosed in double quotation marks ("")


<Example>

<Example> description </example>


Description: A description of the sample code.

Use the <example> flag to specify the usage method or examples of other library members. Generally, this involves the use of the <code> flag.
<Include>

<Include file = 'filename' path = 'tagpath [@ name = "id"] '/>

Filename contains the file name. The file name can be specified by path. Enclose filename in single quotes ('').

Tagpath: The Path in filename that points to the tag name. Enclose this path in single quotes ('').

Name indicates the name specifier in the front mark. The name has an id.

Id

The id of the tag located before the annotation. Enclose this id in double quotation marks ("").

The <include> flag allows you to reference comments in another file describing types and members in source code. This is an alternative to directly placing document comments in the source code file.

<Include> mark the XML XPath syntax. For more information about how to use custom <include>, see the XPath documentation.

<List>

<List type = "bullet" | "number" | "table">

<Listheader>

<Term> term </term>

<Description> description </description>

</Listheader>

<Item>

<Term> term </term>

<Description> description </description>

</Item>

</List>

Term, which is defined in text.


The definition of an item or term in the description object symbol list or number list.

<Listheader> A block is used to define the title row in a table or definition list. When defining a table, you only need to provide one item for the item in the title.

Each item in the list is specified with <item> blocks. When creating a definition list, you must specify both the term and text. However, for a table, project symbol list, or number list, you only need to provide an item for text.

The number of <item> blocks in a list or table can be customized as needed.

<Permission>

<Permissioncref = "member"> description </permission>


Cref = "member" refers to the member or field that can be called through the current compilation environment. After the compiler checks that a given code element exists, it converts member to the canonicalized element name in the output XML. Member must be enclosed in double quotation marks.


Description.

The <permission> flag allows you to document access to members.System. Security. PermissionSetAllows you to specify access to members.
<Remarks>

<Remarks> description </remarks>


Description.


<Value>

<Value> property-description </value>


Description of the property-description attribute.








This article is from the "Better_Power_Wisdom" blog, please be sure to keep this source http://aonaufly.blog.51cto.com/3554853/1301062

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: info-contact@alibabacloud.com 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.