VS adds the file description when creating the C # class,

Source: Internet
Author: User

VS adds the file description when creating the C # class,

When creating a new C # class, you must add some information at the beginning of the file to describe the function of the class and the information about file creation and protect your copyright. As follows:

 1 /***********************************************************************************  2 *        Filename :Class3  3 *        Description :   4 *        Date:2014/5/15 16:31:29  5  *       Machinename:PC-201305061330  6 *        Created by: <T> Andy Sun  7 *        All rights reserved  8 *  9 *       ChangeLog: 10 *       2014/5/15 16:31:29: 11  *          Created! 12 ************************************************************************************/  13 using System;  14 using System.Collections.Generic;  15 using System.Linq;  16 using System.Text;  17 using System.Threading.Tasks; 

Manual addition is time-consuming and labor-consuming. Fortunately, vs provides us with a template change interface. The following is a brief introduction.

1. First, find the C # class template. The installation directory % \ Common7 \ IDE \ ItemTemplatesCache \ CSharp \ Code \ 2052 \ Class (or % VS installation directory % \ Common7 \ IDE \ ItemTemplates \ CSharp \ Code/2052 \ Class) class. cs file.

2. open the file and add the following information to the file header:

 1 /***********************************************************************************  2 *        Filename :$safeitemrootname$  3 *        Description :   4 *        Date:$time$  5  *       Machinename:$machinename$  6 *        Created by: <T> Andy Sun  7 *        All rights reserved  8 *  9 *       ChangeLog: 10 *       $time$: 11  *          Created! 12 ************************************************************************************/  13 using System;  14 using System.Collections.Generic;  15 $if$ ($targetframeworkversion$ >= 3.5)using System.Linq;  16 $endif$using System.Text;  17 $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;  18 $endif$  19 namespace $rootnamespace$  20 {  21     class $safeitemrootname$  22     {  23     }  24 }  

3. After saving the file, you can see that the relevant information is automatically added to the file header when you create a C # class.

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.