Skip to content

Instantly share code, notes, and snippets.

@ecampidoglio
Created October 6, 2011 09:16
Show Gist options
  • Save ecampidoglio/1266935 to your computer and use it in GitHub Desktop.
Save ecampidoglio/1266935 to your computer and use it in GitHub Desktop.
Visual Studio Code Snippet that adds a StyleCop compliant file header comment with company and copyright information.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>File Header</Title>
<Author>Enrico Campidoglio</Author>
<Shortcut>fh</Shortcut>
<Description>Adds a StyleCop compliant file header comment with company and copyright information.</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>FileName</ID>
<ToolTip>The current file name.</ToolTip>
<Default>FileName</Default>
</Literal>
<Literal>
<ID>CompanyName</ID>
<ToolTip>The name of the company holding the copyright.</ToolTip>
<Default>CompanyName</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[//-----------------------------------------------------------------------
// <copyright file="$FileName$.cs" company="$CompanyName$">
// Copyright (c) $CompanyName$. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
$end$
]]>
</Code>
</Snippet>
</CodeSnippet>
@suzhou01
Copy link

suzhou01 commented Jun 3, 2016

Is the literal FileName able to be a function to get the file name automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment