Visual studio +2010 Code Snippets customization
This is my favorites code snippets in visual studio
- Class structure
- Mehtod structure
- Class object definition
- Copy *.snippet files in any directory you want.
- In visual studio Tools menu > Code Snippets Manager
- Select CSharp Language and Select My Code Snippets
- Click on Import and select *.snippet files.
- Enjoy
Type pclass and double tap:
public class MyClass
{
// Your code
}
There is 2 type of methods:
- Static methods
Type ps for methods without parameter
Or you can type ps1 to 3 for methods with argument
public static void Method() { //Your code }
public static void Method(TYPE1 paramName1, TYPE2 paramName2, TYPE3 paramName3) { //Your code }
- Non static methods
Also you can type pv (pv1, pv2, pv3) for non static methods
public void Method(TYPE paramName) { //Your code }
Type obj and double tap:
ClassName obj = new ClassName();