I've created a code snippet in VS2010. It isn't showing as a shortcut when I start typing. I've called it propnch.
It is available when I use Ctrl-K, Ctrk-X but when I just start typing prop... it isn't showing as an option.
Have I missed some kind of setting somewhere?
I had screen shots, but I don't think SO lets you upload any.
Edit: Screen Shots
I can see my snippet with Ctrl-K, Ctrl-X (its gone grey when I ctrl-PrtScn to take the screenshot)
But It doesn't appear with the other snippet shortcuts.
The snippet code is here (taken from this tutorial) and is in the "Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets" folder.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propnch</Title>
<Shortcut>propnch</Shortcut>
<Description>Code snippet for property and backing field and ensure
that it invokes INotifyPropertyChanigng and INotifyPropertyChanged</Description>
<Author>Abhishek</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property name</ToolTip>
<Default>MyProperty</Default>
</Literal>
<Literal>
<ID>field</ID>
<ToolTip>The variable backing this property</ToolTip>
<Default>myVar</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
private $type$ $field$;
public $type$ $property$
{
get
{
return $field$;
}
set
{
this.OnPropertyChanging("$property$");
$field$ = value;
this.OnPropertyChanged("$property$");
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
propnch
, and it works fine. – Jinx