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 |