Code snippets defined by Visual Studio events

Source: Internet
Author: User

Visual Studio does not provide a complete event-defined code snippets. There is only one code snippets called invoke for thread-safe event calls. This invoke has some inconveniences, use of invoke:

 

First, you need to specify the eventhandler type. This is solved in the VaR after C #3.0, and no special write type is required, now few people write C # in Visual Studio 2005 or earlier versions, so we can popularize var.

 

Second, the code snippets does not provide any parameters for the event call. You have to write it by yourself. After you define it, press enter and the cursor will be placed in the parameter brackets, you need to add this and E on your own. Inconvenient.

 

Share the code snippets, Eve, and eveg of two commonly used events (maybe you have used other similar events)

 

 

Eve stands for defining an eventhandler type event. All you need to do is enter your event name. Other events are generated for you.

 

Eveg is the execution of the eventhandler <t> generic type, with an additional generic parameter type:

 

 

File Download

Note: This is an archive of Microsoft SkyDrive. Please download it directly in your browser. Some download tools may not be available for download.
File Type:. snippet

 

 

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.