Snippet: internal event with EventHandler<T>

property value
IDE Visual Studio
Language C#
Title internal event with EventHandler<T>
Shortcut iet
Description internal event declaration with EventHandler<T>
Snippet Types Expansion
Namespaces System

Placeholders

Identifier Tooltip Default Value Editable Function Type Name
eventArgs EventArgs type name EventArgs yes
name Event name EventName yes

Code

internal event EventHandler<EventArgs> EventName;

protected virtual void OnEventName(EventArgs e) {
	EventHandler<EventArgs> handler = EventName;
	if (handler != null) {
		handler(this, e);
	}
}