Create Event Trigger
- 2 minutes to read
Purpose
This Code Provider creates a method called event trigger, which is used to raise the event. The event trigger creates the event instance, ensures it is not null and raises the event using the parameters passed to the event trigger (sender and event arguments).
Availability
Available when the caret is on the event name in its declaration.
Usage
Place the caret on the event name in its declaration.
Note
The blinking cursor shows the caret’s position at which the Code Provider is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Create Event Trigger from the menu.
After execution, the Code Provider creates a new method in your class. Use this method to raise the event.