65.9K
CodeProject is changing. Read more.
Home

Code Snippet for Page Heading Comments.

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.80/5 (5 votes)

Aug 27, 2007

CPOL

1 min read

viewsIcon

25959

downloadIcon

202

This is just a Code Snippet for Page Heading Comment to manage the code efficiently

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="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

 <CodeSnippet Format="1.0.0">
  <Header>
   <Title>#Pageheader </Title>
   <Shortcut>#Pageheader</Shortcut>
   <Description>Code snippet for Page Heading Details</Description>
   <Author>Rajesh ("mailto:rsoni1980@yahoo.com)</Author">rsoni1980@yahoo.com)</Author>
   <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 
/**********
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.
****************/
#endregion Page Header ]]>
   </Code>
  </Snippet>
 </CodeSnippet>
</CodeSnippets> 

VB.NET Code Snippet.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">

 <CodeSnippet Format="1.0.0">
  <Header>
   <Title>#Pageheader </Title>
   <Shortcut>#Pageheader</Shortcut>
   <Description>Code snippet for Page Heading Details</Description>
   <Author>Rajesh ("mailto:rsoni1980@yahoo.com)</Author">rsoni1980@yahoo.com)</Author>
   <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>