Code Snippets in Visual Studio 2005
page 3 of 7
by Bilal Haidar
Feedback
Average Rating: 
Views (Total / Last 10 Days): 35441/ 165

Major Parts of a Code Snippet

The code snippet consists of two main parts:

  • Header
  • Snippet

 

The Header has the following sections:

  • Title
  • Shortcut
  • Description
  • Author
  • SnippetTypes

 

The Header is the code snippets meta-data which includes the title of the code snippet, a shortcut to access the code snippet, a description explaining what the code snippet does, and other relevant information.

The Snippet has a mandatory section and an optional one:

  • Declarations
  • Code

The required section is the Code section. In this section you define the code emitted by the code snippet. The optional Declarations section is used to define the replaceable values in the code snippet. Replicable values are represented by $value$ in the Code section; they are displayed as green and are configurable by the developer using the code snippet.

 

Code snippets are language-specific. Visual Studio 2005 ships with a number of ready code snippets for both Visual Basic and C#. You can find all the code snippet files at the following path:

{Drive Letter}:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C#

 


View Entire Article

User Comments

Title: developer   
Name: sunil
Date: 2009-10-27 9:23:04 AM
Comment:
very nice exmpl
Title: developer   
Name: nanda
Date: 2007-08-06 2:00:31 AM
Comment:
nice article..
Title: Developer   
Name: Stefan Leoni
Date: 2006-12-13 7:18:51 AM
Comment:
concise. Excactly what i was looking for.

Thanks.
Title: Re:   
Name: Bilal Haidar
Date: 2006-01-20 3:38:15 PM
Comment:
You can now, discuss, comment, and ask me questions related to this article at this forum:

http://bhaidar.net/cs/forums/10/ShowForum.aspx

Regards
Title: Solution Developer   
Name: Mostafa
Date: 2006-01-07 3:05:53 AM
Comment:
Good Article.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-08 9:03:14 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search