This is my first ever blog on Internet. I Will try my best to do make this blog user freindly and less complex.
Have you ever press tab 2 time after writing for or if or while or try. You will get following code automatically written to ur page.
for (int i = 0; i < length; i++)
{
}
This particular thing is known as snippet. Which will be automatically generated text. Have you ever thought from where this text is coming ??Answer is its stored in XML files . The path for this thing is
C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C#
it has many xml files for different snippet.
Each snippet file is devided in 2 part Header and snippet. In header part you can describe your snippet. And in ur snippet tag u can actually define your snippet.
<Header>
<Title>for</Title>
<Shortcut>for</Shortcut>
<Description>Code snippet for ‘for’ loop</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>index</ID>
<Default>i</Default>
<ToolTip>Index</ToolTip>
</Literal>
<Literal>
<ID>max</ID>
<Default>length</Default>
<ToolTip>Max length</ToolTip>
</Literal>
</Declarations>
<Code Language=”csharp”><![CDATA[for (int $index$ = 0; $index$ < $max$; $index$++)
{
$selected$ $end$
}]]>
</Code>
</Snippet>
After creating file , you need to add this snippet file to Snippet manager.
You can go to Tools -> code Snippet Manager -> Add New
So by doing this kind of thing we can reduce our time to fo coding.