SlideShare a Scribd company logo
1 of 11
Code snippets for c# (CSharp).net
Brought to you by www.SiryMedia.in
• Code snippets are ready-made snippets of code you can quickly
insert into your code. For example, the for code snippet creates
an empty for loop.
• Some code snippets are surround-with code snippets, which
enable you to select lines of code, and then choose a code
snippet which incorporates the selected lines of code.
• For example, when you select lines of code and then activate
the for code snippet, it creates a for loop with those lines of code
inside the loop block. Code snippets can make writing program
code quicker, easier, and more reliable.
• Snippets are a useful feature in the Visual Studio IDE. With
them, you can type a few letters and then press tab twice to
insert a code fragment. They help reduce repetitive
statements and can reduce overuse injuries with your
hands.
• Ctor. First, the ctor snippet is available in Visual Studio
2010. To use ctor, place the cursor inside a class body. Then,
type the four letters 'ctor' and press tab twice. This article
shows what happens after you press TAB TAB.
Name (or
shortcut)
Description Valid locations to insert snippet
#if Creates a #if directive and a #endif directive. Anywhere.
#region Creates a #region directive and a #endregion directive. Anywhere.
~ Creates a destructor for the containing class. Inside a class.
attribute Creates a declaration for a class that derives
from Attribute.
Inside a namespace (including the global
namespace), a class, or a struct.
checked Creates a checked block. Inside a method, an indexer, a property
accessor, or an event accessor.
class Creates a class declaration. Inside a namespace (including the global
namespace), a class, or a struct.
ctor Creates a constructor for the containing class. Inside a class.
cw Creates a call to WriteLine. Inside a method, an indexer, a property accessor, or
an event accessor.
do Creates a do while loop. Inside a method, an indexer, a property accessor, or
an event accessor.
else Creates an else block. Inside a method, an indexer, a property accessor, or
an event accessor.
enum Creates an enum declaration. Inside a namespace (including the global
namespace), a class, or a struct.
equals Creates a method declaration that overrides
the Equals method defined in the Object class.
Inside a class or a struct.
exception Creates a declaration for a class that derives from an
exception (Exception by default).
Inside a namespace (including the global
namespace), a class, or a struct.
for Creates a for loop. Inside a method, an indexer, a property
accessor, or an event accessor.
foreach Creates a foreach loop. Inside a method, an indexer, a property
accessor, or an event accessor.
forr Creates a for loop that decrements the loop variable after
each iteration.
Inside a method, an indexer, a property
accessor, or an event accessor.
if Creates an if block. Inside a method, an indexer, a property
accessor, or an event accessor.
indexer Creates an indexer declaration. Inside a class or a struct.
interface Creates an interface declaration. Inside a namespace (including the global
namespace), a class, or a struct.
invoke Creates a block that safely invokes an event. Inside a method, an indexer, a property accessor,
or an event accessor.
iterator Creates an iterator. Inside a class or a struct.
iterindex Creates a "named" iterator and indexer pair by using a
nested class.
Inside a class or a struct.
lock Creates a lock block. Inside a method, an indexer, a property accessor,
or an event accessor.
mbox Creates a call to MessageBox.Show. You may have to add
a reference to System.Windows.Forms.dll.
Inside a method, an indexer, a property accessor,
or an event accessor.
namespace Creates a namespace declaration. Inside a namespace (including the global
namespace).
prop Creates an auto-implemented property declaration. Inside a class or a struct.
propfull Creates a property declaration with get and set accessors. Inside a class or a struct.
propg Creates a read-only auto-implemented property with a private
"set" accessor.
Inside a class or a struct.
sim Creates a static int Main method declaration. Inside a class or a struct.
struct Creates a struct declaration. Inside a namespace (including the global
namespace), a class, or a struct.
svm Creates a static void Main method declaration. Inside a class or a struct.
switch Creates a switch block. Inside a method, an indexer, a property
accessor, or an event accessor.
try Creates a try-catch block. Inside a method, an indexer, a property accessor, or an event
accessor.
tryf Creates a try-finally block. Inside a method, an indexer, a property accessor, or an event
accessor.
unchecked Creates an unchecked block. Inside a method, an indexer, a property accessor, or an event
accessor.
unsafe Creates an unsafe block. Inside a method, an indexer, a property accessor, or an event
accessor.
using Creates a using directive. Inside a namespace (including the global namespace).
while Creates a while loop. Inside a method, an indexer, a property accessor, or an event
accessor.
• For more understanding visit our c# program example
playlist in our channel SIRYMEDIA
Or
• Click below links in description
Thank You
For more updates subscribe to our Youtube channel
SiryMedia
To watch more vidoes visit our website
www.sirymedia.in

More Related Content

What's hot (10)

Python dictionary
Python dictionaryPython dictionary
Python dictionary
 
Constructor overloading & method overloading
Constructor overloading & method overloadingConstructor overloading & method overloading
Constructor overloading & method overloading
 
Parte II Objective C
Parte II   Objective CParte II   Objective C
Parte II Objective C
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
 
core java
core javacore java
core java
 
Introduction to OOP with PHP
Introduction to OOP with PHPIntroduction to OOP with PHP
Introduction to OOP with PHP
 
Python Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M20 - Classes and ObjectsPython Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M20 - Classes and Objects
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Polymorphism in C# Function overloading in C#
Polymorphism in C# Function overloading in C#Polymorphism in C# Function overloading in C#
Polymorphism in C# Function overloading in C#
 

Viewers also liked

CV_ShengkaiWANG_Oct2016
CV_ShengkaiWANG_Oct2016CV_ShengkaiWANG_Oct2016
CV_ShengkaiWANG_Oct2016Shengkai Wang
 
מצגת רמז ליום העיון
מצגת רמז ליום העיוןמצגת רמז ליום העיון
מצגת רמז ליום העיוןDr. Peri Sinclair
 
what is .net
what is .netwhat is .net
what is .netSireesh K
 
сангвінік
сангвініксангвінік
сангвінікArtem352
 
Презентація кількісних показників російської військової присутності в Криму
Презентація кількісних показників російської військової присутності в КримуПрезентація кількісних показників російської військової присутності в Криму
Презентація кількісних показників російської військової присутності в Кримуtsnua
 
Making a difference - web-email
Making a difference - web-emailMaking a difference - web-email
Making a difference - web-emailManu Perez
 
Turcsoki_Péter_Portfólió_small05.31
Turcsoki_Péter_Portfólió_small05.31Turcsoki_Péter_Portfólió_small05.31
Turcsoki_Péter_Portfólió_small05.31Peter Turcsoki
 
Surf Label Design Concepts
Surf Label Design ConceptsSurf Label Design Concepts
Surf Label Design ConceptsKristen Hadden
 

Viewers also liked (10)

CV_ShengkaiWANG_Oct2016
CV_ShengkaiWANG_Oct2016CV_ShengkaiWANG_Oct2016
CV_ShengkaiWANG_Oct2016
 
מצגת רמז ליום העיון
מצגת רמז ליום העיוןמצגת רמז ליום העיון
מצגת רמז ליום העיון
 
what is .net
what is .netwhat is .net
what is .net
 
сангвінік
сангвініксангвінік
сангвінік
 
Pptb b indo
Pptb b indoPptb b indo
Pptb b indo
 
Презентація кількісних показників російської військової присутності в Криму
Презентація кількісних показників російської військової присутності в КримуПрезентація кількісних показників російської військової присутності в Криму
Презентація кількісних показників російської військової присутності в Криму
 
Kalkulus
KalkulusKalkulus
Kalkulus
 
Making a difference - web-email
Making a difference - web-emailMaking a difference - web-email
Making a difference - web-email
 
Turcsoki_Péter_Portfólió_small05.31
Turcsoki_Péter_Portfólió_small05.31Turcsoki_Péter_Portfólió_small05.31
Turcsoki_Péter_Portfólió_small05.31
 
Surf Label Design Concepts
Surf Label Design ConceptsSurf Label Design Concepts
Surf Label Design Concepts
 

Similar to Snippet for .net

Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptxAdikhan27
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014Matthias Noback
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionCSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionMohammad Shaker
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)David McCarter
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84Mahmoud Samir Fayed
 
The Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony BarcelonaThe Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony BarcelonaMatthias Noback
 
PRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.comPRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.comMcdonaldRyan108
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
UNIT III.ppt
UNIT III.pptUNIT III.ppt
UNIT III.pptAjit Mali
 
Is2215 lecture2 student(2)
Is2215 lecture2 student(2)Is2215 lecture2 student(2)
Is2215 lecture2 student(2)dannygriff1
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Unit3 part3-packages and interfaces
Unit3 part3-packages and interfacesUnit3 part3-packages and interfaces
Unit3 part3-packages and interfacesDevaKumari Vijay
 

Similar to Snippet for .net (20)

Java Basics
Java BasicsJava Basics
Java Basics
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Generics
GenericsGenerics
Generics
 
Object-oriented programming 3.pptx
Object-oriented programming 3.pptxObject-oriented programming 3.pptx
Object-oriented programming 3.pptx
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionCSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
 
The Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony BarcelonaThe Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony Barcelona
 
Unit iii
Unit iiiUnit iii
Unit iii
 
PRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.comPRG 421 Education Specialist / snaptutorial.com
PRG 421 Education Specialist / snaptutorial.com
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
UNIT III.ppt
UNIT III.pptUNIT III.ppt
UNIT III.ppt
 
UNIT III (2).ppt
UNIT III (2).pptUNIT III (2).ppt
UNIT III (2).ppt
 
Is2215 lecture2 student(2)
Is2215 lecture2 student(2)Is2215 lecture2 student(2)
Is2215 lecture2 student(2)
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Unit3 part3-packages and interfaces
Unit3 part3-packages and interfacesUnit3 part3-packages and interfaces
Unit3 part3-packages and interfaces
 
Prg421
Prg421Prg421
Prg421
 

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Snippet for .net

  • 1. Code snippets for c# (CSharp).net Brought to you by www.SiryMedia.in
  • 2. • Code snippets are ready-made snippets of code you can quickly insert into your code. For example, the for code snippet creates an empty for loop. • Some code snippets are surround-with code snippets, which enable you to select lines of code, and then choose a code snippet which incorporates the selected lines of code. • For example, when you select lines of code and then activate the for code snippet, it creates a for loop with those lines of code inside the loop block. Code snippets can make writing program code quicker, easier, and more reliable.
  • 3. • Snippets are a useful feature in the Visual Studio IDE. With them, you can type a few letters and then press tab twice to insert a code fragment. They help reduce repetitive statements and can reduce overuse injuries with your hands. • Ctor. First, the ctor snippet is available in Visual Studio 2010. To use ctor, place the cursor inside a class body. Then, type the four letters 'ctor' and press tab twice. This article shows what happens after you press TAB TAB.
  • 4. Name (or shortcut) Description Valid locations to insert snippet #if Creates a #if directive and a #endif directive. Anywhere. #region Creates a #region directive and a #endregion directive. Anywhere. ~ Creates a destructor for the containing class. Inside a class. attribute Creates a declaration for a class that derives from Attribute. Inside a namespace (including the global namespace), a class, or a struct. checked Creates a checked block. Inside a method, an indexer, a property accessor, or an event accessor.
  • 5. class Creates a class declaration. Inside a namespace (including the global namespace), a class, or a struct. ctor Creates a constructor for the containing class. Inside a class. cw Creates a call to WriteLine. Inside a method, an indexer, a property accessor, or an event accessor. do Creates a do while loop. Inside a method, an indexer, a property accessor, or an event accessor. else Creates an else block. Inside a method, an indexer, a property accessor, or an event accessor. enum Creates an enum declaration. Inside a namespace (including the global namespace), a class, or a struct.
  • 6. equals Creates a method declaration that overrides the Equals method defined in the Object class. Inside a class or a struct. exception Creates a declaration for a class that derives from an exception (Exception by default). Inside a namespace (including the global namespace), a class, or a struct. for Creates a for loop. Inside a method, an indexer, a property accessor, or an event accessor. foreach Creates a foreach loop. Inside a method, an indexer, a property accessor, or an event accessor. forr Creates a for loop that decrements the loop variable after each iteration. Inside a method, an indexer, a property accessor, or an event accessor. if Creates an if block. Inside a method, an indexer, a property accessor, or an event accessor. indexer Creates an indexer declaration. Inside a class or a struct.
  • 7. interface Creates an interface declaration. Inside a namespace (including the global namespace), a class, or a struct. invoke Creates a block that safely invokes an event. Inside a method, an indexer, a property accessor, or an event accessor. iterator Creates an iterator. Inside a class or a struct. iterindex Creates a "named" iterator and indexer pair by using a nested class. Inside a class or a struct. lock Creates a lock block. Inside a method, an indexer, a property accessor, or an event accessor. mbox Creates a call to MessageBox.Show. You may have to add a reference to System.Windows.Forms.dll. Inside a method, an indexer, a property accessor, or an event accessor. namespace Creates a namespace declaration. Inside a namespace (including the global namespace).
  • 8. prop Creates an auto-implemented property declaration. Inside a class or a struct. propfull Creates a property declaration with get and set accessors. Inside a class or a struct. propg Creates a read-only auto-implemented property with a private "set" accessor. Inside a class or a struct. sim Creates a static int Main method declaration. Inside a class or a struct. struct Creates a struct declaration. Inside a namespace (including the global namespace), a class, or a struct. svm Creates a static void Main method declaration. Inside a class or a struct. switch Creates a switch block. Inside a method, an indexer, a property accessor, or an event accessor.
  • 9. try Creates a try-catch block. Inside a method, an indexer, a property accessor, or an event accessor. tryf Creates a try-finally block. Inside a method, an indexer, a property accessor, or an event accessor. unchecked Creates an unchecked block. Inside a method, an indexer, a property accessor, or an event accessor. unsafe Creates an unsafe block. Inside a method, an indexer, a property accessor, or an event accessor. using Creates a using directive. Inside a namespace (including the global namespace). while Creates a while loop. Inside a method, an indexer, a property accessor, or an event accessor.
  • 10. • For more understanding visit our c# program example playlist in our channel SIRYMEDIA Or • Click below links in description
  • 11. Thank You For more updates subscribe to our Youtube channel SiryMedia To watch more vidoes visit our website www.sirymedia.in