Skip to content

Instantly share code, notes, and snippets.

@waf
Created September 10, 2015 04:05
Show Gist options
  • Save waf/db1ee6b539bad7f7a2c5 to your computer and use it in GitHub Desktop.
Save waf/db1ee6b539bad7f7a2c5 to your computer and use it in GitHub Desktop.
VS2015 snippets for public and private methods
<!-- put this in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\Visual C#\pubm.snippet -->
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>pubm</Title>
<Shortcut>pubm</Shortcut>
<Description>Code snippet for public method</Description>
<Author>Will Fuqua</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>methodname</ID>
<ToolTip>Method name</ToolTip>
<Default>MethodName</Default>
</Literal>
<Literal>
<ID>type</ID>
<ToolTip>Return type</ToolTip>
<Default>type</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public $type$ $methodname$ ()
{
$end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
<!-- put this in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\Visual C#\privm.snippet -->
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>privm</Title>
<Shortcut>privm</Shortcut>
<Description>Code snippet for private method</Description>
<Author>Will Fuqua</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>methodname</ID>
<ToolTip>Method name</ToolTip>
<Default>MethodName</Default>
</Literal>
<Literal>
<ID>type</ID>
<ToolTip>Return type</ToolTip>
<Default>type</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[private $type$ $methodname$ ()
{
$end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment