Snippet: private event

property value
IDE Visual Studio
Language C#
Title private event
Shortcut pet
Description private event declaration
Snippet Types Expansion
Namespaces System

Placeholders

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

Code

private event EventHandler EventName;

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