-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrevent.snippet
More file actions
51 lines (50 loc) · 1.75 KB
/
revent.snippet
File metadata and controls
51 lines (50 loc) · 1.75 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
<?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>WPF のイベントシステムに登録するルーティングイベントを作成します。</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Shortcut>revent</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>eventName</ID>
<ToolTip>イベント名</ToolTip>
<Default>EventName</Default>
</Literal>
<Literal>
<ID>class</ID>
<ToolTip>追加するクラス</ToolTip>
<Function>ClassName()</Function>
</Literal>
<Literal>
<ID>eventComment</ID>
<ToolTip>イベントのコメント</ToolTip>
<Default>イベントが発生します。</Default>
</Literal>
</Declarations>
<Code Language="csharp" Kind="method decl">
<![CDATA[/// <summary>
/// <see cref="$eventName$"/>ルーティングイベントを識別します。
/// </summary>
public static readonly RoutedEvent $eventName$Event = EventManager.RegisterRoutedEvent(
"$eventName$",
RoutingStrategy.Direct,
typeof(RoutedEventHandler),
typeof($class$));
/// <summary>
/// $eventComment$
/// </summary>
public event RoutedEventHandler $eventName$
{
add { AddHandler($eventName$Event, value); }
remove { RemoveHandler($eventName$Event, value); }
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>