Created
March 29, 2014 22:13
-
-
Save Warpten/9863889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>propnotify</Title> | |
<Author>Giacomo Pozzoni</Author> | |
<Description>Poperty with OnPropertyChanged event</Description> | |
<HelpUrl></HelpUrl> | |
<SnippetTypes /> | |
<Keywords /> | |
<Shortcut>propnotify</Shortcut> | |
</Header> | |
<Snippet> | |
<References /> | |
<Imports /> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>NewLiteral</ID> | |
<Type></Type> | |
<ToolTip></ToolTip> | |
<Default>NewLiteral</Default> | |
<Function></Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>type</ID> | |
<Type></Type> | |
<ToolTip></ToolTip> | |
<Default>string</Default> | |
<Function></Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>name</ID> | |
<Type></Type> | |
<ToolTip></ToolTip> | |
<Default>NewProperty</Default> | |
<Function></Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>privateName</ID> | |
<Type></Type> | |
<ToolTip></ToolTip> | |
<Default>_newProperty</Default> | |
<Function></Function> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp" Kind="method decl" Delimiter="$"><![CDATA[public $type$ $name$ | |
{ | |
get | |
{ | |
return $privateName$; | |
} | |
private set | |
{ | |
if (On$name$Changed != null) | |
On$name$Changed($privateName$, value); | |
$privateName$ = value; | |
} | |
} | |
$type$ $privateName$; | |
public event Action<$type$,$type$> On$name$Changed;]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment