1-class head comment Template

Source: Internet
Author: User

I have been using vs for writing recently.ProgramWrite Class header comments according to programming specifications. Some people say that this is not simple. It is okay to write a Class header annotation and copy and paste it. You are out! "Don't worry, don't know ". In fact, when creating a class, VS can automatically add pre-defined comments for us. What are the steps? Let's witness the miracle step by step (taking VB. NET as an example ).


Steps:

1. Find the class. VB file and open it in Notepad mode.(You can directly search for it or manually find the vs installation directory. Enter itemtemplatescache \ VisualBasic \ code \ 2052 \ class to find the class. VB file)


2. Add and save the content. For example:


3. When a new class is created in the future, the set Class header comments will be automatically added.



Note:

1. Annotations of other types can also be customized.
We will introduce it based on the class. However, you can also define Annotation Templates for other content, such as "Web class libraries" or "interfaces" (The web class is in Class. VB under webclass, and the interfaces are in the interface folder ). Of course, other development languages (such as C #) integrated in vs can also be customized.
Ii. parameter settings

$ Var $ is a system variable. The template parameters are case sensitive. The available parameters provided by the system are as follows:

Parameter  Description
Clrversion Current version of the Common Language Runtime Library (CLR)
Guid [1-10] The GUID used to replace the project guid in the project file. You can specify a maximum of 10 unique guid1 guid1 ))
Itemname Name provided by the user in the Add new project dialog box
Machinename Current computer name (for example, computer01)
Projectname Name provided by the user in the Create Project dialog box
Registeredorganization Registry Key Value in HKLM/software/Microsoft/Windows NT/CurrentVersion/registeredorganization
Rootnamespace The root namespace of the current project. This parameter is used to replace the namespace in the items added to the forward project.
Safeitemname The name provided by the user in the "Add new item" dialog box. The name is removed from all unsafe characters and spaces.
Safeprojectname The name provided by the user in the "New Project" dialog box. The name is removed from all unsafe characters and spaces.
Time Added in the system format to indicate the current time (date + time)
Userdomain Current User Domain
Username Current User Name
Year Current year in yyyy format

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.