-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent.snippet
More file actions
37 lines (36 loc) · 1.21 KB
/
event.snippet
File metadata and controls
37 lines (36 loc) · 1.21 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
<?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>event</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>eventName</ID>
<ToolTip>イベントハンドラーの名前</ToolTip>
<Default>Event</Default>
</Literal>
</Declarations>
<Code Language="csharp" Kind="method decl">
<![CDATA[public event EventHandler $eventName$;
/// <summary>
/// <see cref="$eventName$"/>イベントを発生させます。
/// </summary>
protected virtual void On$eventName$()
{
var handler = $eventName$;
if (handler != null)
{
handler(this, EventArgs.Empty);
}
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>