-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpropa.snippet
More file actions
62 lines (60 loc) · 2.07 KB
/
propa.snippet
File metadata and controls
62 lines (60 loc) · 2.07 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2010/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>添付プロパティ</Title>
<Description>添付プロパティを作成します。</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Shortcut>propa</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>プロパティの型</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>プロパティ名</ToolTip>
<Default>MyProperty</Default>
</Literal>
<Literal>
<ID>targetClass</ID>
<ToolTip>アタッチする対象のクラス</ToolTip>
<Default>DependencyObject</Default>
</Literal>
<Literal>
<ID>propertyComment</ID>
<ToolTip>プロパティのコメント</ToolTip>
<Default>プロパティ</Default>
</Literal>
</Declarations>
<Code Language="csharp" Kind="method decl">
<![CDATA[/// <summary>
/// <c>$property$</c>添付プロパティを識別します。
/// </summary>
public static readonly DependencyProperty $property$Property = DependencyProperty.RegisterAttached(
"$property$",
typeof($type$),
typeof($targetClass$));
/// <summary>
/// $propertyComment$を取得します。
/// </summary>
public static $type$ Get$property$($targetClass$ obj)
{
return ($type$)obj.GetValue($property$Property);
}
/// <summary>
/// $propertyComment$を設定します。
/// </summary>
public static void Set$property$($targetClass$ obj, $type$ value)
{
obj.SetValue($property$Property, value);
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>