Changeset 7473 for trunk/tools/HL3Snippets/HL3.DefineGenericEvent.snippet
- Timestamp:
- 02/16/12 08:21:43 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/HL3Snippets/HL3.DefineGenericEvent.snippet
r5061 r7473 32 32 </Function> 33 33 </Literal> 34 <Literal Editable="true"> 35 <ID>Modifier</ID> 36 <ToolTip>Visibility modifier</ToolTip> 37 <Default>protected virtual</Default> 38 <Function> 39 </Function> 40 </Literal> 34 41 </Declarations> 35 42 <Code Language="csharp"><![CDATA[public event EventHandler<EventArgs<$ArgsType$>> $EventName$; 36 37 protected virtual void On$EventName$($ArgsType$ args) { 38 EventHandler<EventArgs<$ArgsType$>> handler = $EventName$; 39 if (handler != null) 40 handler(this, new EventArgs<$ArgsType$>(args)); 43 $Modifier$ void On$EventName$($ArgsType$ args) { 44 var handler = $EventName$; 45 if (handler != null) handler(this, new EventArgs<$ArgsType$>(args)); 41 46 }]]></Code> 42 47 </Snippet>
Note: See TracChangeset
for help on using the changeset viewer.