Click here to Skip to main content
Click here to Skip to main content

Code Snippet for Page Heading Comments.

, 26 Aug 2007
Rate this:
Please Sign up or sign in to vote.
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

rsoni1980
Technical Lead
India India
Rajesh Soni
 
MCAD : Sharepoint 2010
MCTS : MOSS App Development & Configuration
MCTS (Microsoft Certified Technology Specialist) - Web Applications.

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 27 Aug 2007
Article Copyright 2007 by rsoni1980
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid