Visual Studio annotation specifications

Source: Internet
Author: User

Most people know that Visual Studio uses/* code blocks */and // code lines to annotate code,

However, there is no standard comment on functions and classes in the code.

Visual Studio provides the ability to create code reports.TheThe annotation method can be very

Good standards our annotations make the code more readable.

Below are some annotations

First, add the following tags

  • <Summary> </Summary>.
  • <Remarks> </remarks> remarks.
  • <Param> </param> use a parameter to describe the method in the annotation of the method declaration.
  • <Returns> </returns> in the comment of the method declaration, use to describe the return value.
  • <Newpara> </newpara> Start a new section in the comment.
  • Example:

    Using system;
    Namespace helloworld
    {
    /// <Summary>
    /// Sample Hello world in C #
    /// </Summary>
    Public class helloworld
    {
    /// <Summary>
    /// Console application entry point

    /// </Summary>
    /// <Param name = "ARGs"> command line arguments </param>
    /// <Returns> Status Code of 0 on successful run </returns>

    Public static int main (string [] ARGs)
    {
    System. Console. writeline ("helloworld ");
    String name = system. Console. Readline ();
    Return (0 );
    }
    }
    }

    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.