Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
- <Header>
- <Title>propnotif</Title>
- <Author>Solal Pirelli</Author>
- <Shortcut>propnotif</Shortcut>
- <Description>Code snippet for property and backing field. The setter uses FirePropertyChanged</Description>
- <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 this.$field$; }
- set
- {
- if( this.$field$ != value )
- {
- this.$field$ = value;
- this.FirePropertyChanged("$property$");
- }
- }
- }
- ]]>
- </Code>
- </Snippet>
- </CodeSnippet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement