Create Event Trigger

Generates an event trigger for the event under caret.

Availability

Available from the context menu or via shortcuts:

  • when the caret is on an event declaration.

Example

public event EventHandler DataChanged;
Public Event DataChanged As EventHandler

Result:

public event EventHandler DataChanged;
protected virtual void OnDataChanged(object sender, EventArgs e)
{
  EventHandler handler = DataChanged;
  if (handler != null)
    handler(sender, e);
}
Public Event DataChanged As EventHandler
Protected Overridable Sub OnDataChanged(ByVal sender As Object, ByVal e As EventArgs)
  RaiseEvent DataChanged(sender, e)
End Sub