-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event_CustomParam.snippet
37 lines (36 loc) · 1.05 KB
/
Event_CustomParam.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
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Simple Event with Custom Parameter</Title>
<Shortcut>ms_Event_WithCustomParameter</Shortcut>
<Description>Create an Event and a function to raise it. Event parameter is custom</Description>
<Author>Lukas Kiefer</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>System</Namespace>
</Import>
</Imports>
<Declarations>
<Object>
<ID>Parametertype</ID>
<Type>Object</Type>
<ToolTip>Parameter type</ToolTip>
<Default>string</Default>
</Object>
<Object>
<ID>EventName</ID>
<Type>Object</Type>
<ToolTip>Event Name</ToolTip>
<Default>NewEvent</Default>
</Object>
</Declarations>
<Code Language="CSharp"><![CDATA[public event Action<$Parametertype$> On$EventName$ = delegate { };]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>