Introduction
This article/code snippet is use full in managing your code properly. like every class file should contain any comment about auther ,created date and other things. This Article contain two code snippet one is C# and other one is Vb.Net.
Background
Code Snippet are just xml file which we are using in your coding to display predefine code.
Using the code
every coding file (.cs or .vb) should contain the information about auther,created by namespace and other things.
Copy the attached file for following Locations
.
Location for Vb Code Snippet:
C:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033\application
Location for C# Code Snippet:
C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C#
How to use The Code snippet.
For VB.NET
go to your any .vb page and right click at the top line of page.
then click on Insert Snippet. --> Select Application --> Select "#PageHeader"
then write down all the values mentioned at Snippet literals.
For C#
go to your any .cs page and right click at the top line of page.
then click on Insert Snippet. --> Select Visual C# --> Select "#PageHeader"
then write down all the values mentioned at Snippet literals.
if you still find any problem then feel free to talk with me.
Code Snippet
if you find any proble in attached file then copy the following code.
C# Code Snippet.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="<a href="http:
<CodeSnippet Format="1.0.0">
<Header>
<Title>#Pageheader </Title>
<Shortcut>#Pageheader</Shortcut>
<Description>Code snippet for Page Heading Details</Description>
<Author>Rajesh (<a href="mailto:rsoni1980@yahoo.com)</Author">rsoni1980@yahoo.com)</Author</a>>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>ClassName</ID>
<ToolTip>Class Name</ToolTip>
<Default>MyClass</Default>
</Literal>
<Literal>
<ID>CreatedBy</ID>
<ToolTip>Name of the Creator</ToolTip>
<Default></Default>
</Literal>
<Literal>
<ID>CreatedOn</ID>
<ToolTip>Date of Creation</ToolTip>
<Default></Default>
</Literal>
<Literal>
<ID>Interfaces</ID>
<ToolTip>Interfaces on which it is implemented</ToolTip>
<Default>None</Default>
</Literal>
<Literal>
<ID>BaseClass</ID>
<ToolTip>Base Class Name</ToolTip>
<Default>None</Default>
</Literal>
<Literal>
<ID>Purpose</ID>
<ToolTip>Purpose of this Class </ToolTip>
<Default></Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[#region Page Header
#endregion Page Header ]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
VB.NET Code Snippet.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="<a href="http:
<CodeSnippet Format="1.0.0">
<Header>
<Title>#Pageheader </Title>
<Shortcut>#Pageheader</Shortcut>
<Description>Code snippet for Page Heading Details</Description>
<Author>Rajesh (<a href="mailto:rsoni1980@yahoo.com)</Author">rsoni1980@yahoo.com)</Author</a>>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>ClassName</ID>
<ToolTip>Class Name</ToolTip>
<Default>MyClass</Default>
</Literal>
<Literal>
<ID>CreatedBy</ID>
<ToolTip>Name of the Creator</ToolTip>
<Default></Default>
</Literal>
<Literal>
<ID>CreatedOn</ID>
<ToolTip>Date of Creation</ToolTip>
<Default></Default>
</Literal>
<Literal>
<ID>Interfaces</ID>
<ToolTip>Interfaces on which it is implemented</ToolTip>
<Default>None</Default>
</Literal>
<Literal>
<ID>BaseClass</ID>
<ToolTip>Base Class Name</ToolTip>
<Default>None</Default>
</Literal>
<Literal>
<ID>Purpose</ID>
<ToolTip>Purpose of this Class </ToolTip>
<Default></Default>
</Literal>
</Declarations>
<Code Language="VB"><![CDATA[#Region "Page Header"
'Class Name : $ClassName$
'Created By : $CreatedBy$
'Created On : $CreatedOn$
'Interfaces : $Interfaces$
'BaseClass : $BaseClass$
'Purpose : $Purpose$
'Version: Version When Who Why
' 1.0 $CreatedOn$ $CreatedBy$ Initial Draft.
'
#end Region ]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>