Declare EventArgs Descendant

Generates an EventArgs descendant class for a reference to an undeclared type.

Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on a reference to an undeclared type, provided that the type name ends with "EventArgs".

Example

public delegate void MyEventHandler(object sender, MyEventArgs ea)
Public Delegate Sub MyEventHandler(ByVal sender As Object, ByVal ea As MyEventArgs)

Result:

public class MyEventArgs : EventArgs
{
    public MyEventArgs()
    {

    }
}
public delegate void MyEventHandler(object sender, MyEventArgs ea);
Public Class MyEventArgs
    Inherits EventArgs
    Public Sub New()

    End Sub
End Class
Public Delegate Sub MyEventHandler(ByVal sender As Object, ByVal ea As MyEventArgs)