VS2015 Code Snippet Collation

Source: Internet
Author: User
Tags finally block

1. What is a code snippet? Extracts a line of code that can be reused multiple times. The VS IDE provides complete support for code snippets, making code faster, easier, and more reliable. 2 . system Default Code snippetFor the developer's routine tasks, Visual Studio has a default code snippet. The default code snippet is a mixture of code extensions and outside code. The default code snippet appears in the IntelliSense completion list and the code selector. Some of the default code snippets are listed below (2) . system Default Code snippetFor the developer's routine tasks, Visual Studio 2005 has a default code snippet. The default code snippet is a mixture of code extensions and outside code. The default code snippet appears in the IntelliSense completion list and the code selector. Table 1 lists some of the default code snippets.
Code Snippet Name Description
#if The code snippet uses the # if and #endif commands around the code
#region The code snippet uses the #region and #endregion commands around the code
~ The code snippet inserts a destructor
Attribute The code snippet inserts a declaration of a custom property that is a class derived from System.Attribute
Checked The code snippet uses a checked block around the code
Class The code snippet inserts a class declaration
ctor The code snippet inserts a constructor
cw The code snippet inserts a Console.WriteLine statement
Do The snippet surrounds the code with a Do while block
Else The code snippet inserts an else block
Enum The code snippet inserts an enum declaration
equals The code snippet overrides the Equals method inherited from the System.Object type
exception The code snippet inserts a declaration for an application exception that derives from the System.Exception
For The code snippet uses a for loop around the code
Foreach The code snippet uses a foreach loop around the code
Forr The code snippet uses a decrementing for loop around the code
If The code snippet uses an if block around the code
Indexer The code snippet inserts an indexer function
Interface The code snippet inserts an interface declaration
Iterator The code snippet inserts an iterator
Interindex The code snippet inserts a named iterator and indexer
Invoke The code snippet inserts and invokes an event
Lock The code snippet uses a lock block around the code
Mbox The code snippet inserts a MessageBox.Show statement
Namespace The code snippet uses a namespace around the code
Prop The code snippet inserts a property and a fallback field
Propg The code snippet inserts a read-only property. Read-only property has only one get method
Sim The code snippet inserts a static entry method that returns an integer
struct The code snippet inserts a struct declaration
Svm The code snippet inserts a static entry method that returns void
Switch The code snippet inserts a switch statement
Try The code snippet inserts a Try-catch block
Tryf The code snippet inserts a try-finally block
Unchecked The code snippet uses a unchecked block around the code
Unsafe The code snippet inserts an unsafe block
Using The code snippet uses a using block around the code
While The code snippet uses a while loop around the code
Have time to summarize again

VS2015 Code Snippet Collation

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.