Click here to Skip to main content
15,886,799 members
Articles / Programming Languages / Visual Basic
Article

Code Snippet for Page Heading Comments.

Rate me:
Please Sign up or sign in to vote.
1.80/5 (5 votes)
26 Aug 2007CPOL1 min read 25.8K   202   12  
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="<a href="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet</a>">
 <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 
/**********
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="<a href="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet</a>">
 <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>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Rajesh Soni
Specialties: | MCPD- SharePoint 2010
| MCTS - MOSS 2007,WSS 3.0
| MCTS - ASP.NET 2.0
| HTML5,AngularJS,JQuery
| Dot NET 3.5 / 4.0

BLOG : http://mydotnetknowledgeshare.blogspot.in/

Comments and Discussions

 
-- There are no messages in this forum --