Code snippets are convenient way to save time wile writing code. By typing just a few easy to remember keywords you will save a lot of time and implement desired outcome successfully.
By typing following keywords and pressing tab following outcomes will appear. Beware, keywords are case sensitive.
class + Tab will create class
1 2 3 4 5 |
class MyClass { } |
enum + Tab will create enum
1 2 3 4 5 |
enum MyEnum { } |
ctor + Tab will create constructor
1 2 3 4 5 |
public MyClass() { } |
propfull + Tab + string + field+ Tab + Property will create property
1 2 3 4 5 6 7 8 9 10 11 |
private int field; public int Property { get { return field; } set { field= value; } } |
prop + Tab + int + Tab + AutoImpelemntedPropertyName will create auto implemented property
1 |
public int AutoImplemntedPropertyName { get; set; } |
svm + Tab (Useful for your Console program, but remember only one is Main method is allowed)
1 2 3 4 5 |
static void Main(string[] args) { } |
foreach + Tab + dataTypeName + item + collectionName will create foreach loop
1 2 3 4 5 |
foreach (dataTypeName item in collectionName) { } |
try + Tab will create try-catch block
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
try { } catch (Exception) { throw; } |
tryf + Tab will create try-catch block
1 2 3 4 5 6 7 8 9 10 11 |
try { } finally { } |
Â