-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsonprop.snippet
46 lines (46 loc) · 1.32 KB
/
jsonprop.snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>jsonprop</Title>
<Shortcut>jsonprop</Shortcut>
<Description>Code snippet for an automatically implemented JSON backed property Language Version: C# 3.0 or higher</Description>
<Author>Luke Foust</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>string</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property name</ToolTip>
<Default>MyProperty</Default>
</Literal>
<Literal>
<ID>member</ID>
<ToolTip>Member name</ToolTip>
<Default>myProperty</Default>
</Literal>
<Literal>
<ID>jsonName</ID>
<ToolTip>JSON name</ToolTip>
<Default>myProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[private $type$ $member$;
[JsonProperty("$jsonName$")]
public $type$ $property$
{
get { return $member$; }
set { $member$ = value; NotifyOfPropertyChange(() => $property$); }
}$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>