Snippet: private event with EventHandler<T>

property value
IDE VS Code
Language C#
Title private event with EventHandler<T>
Shortcut pet_EventHandlerOfT
Description private event declaration with EventHandler<T>

Placeholders

Identifier Tooltip Default Value
eventArgs EventArgs type name EventArgs
name Event name EventName

Code

private event EventHandler<EventArgs> EventName;

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