Tuesday, November 22, 2005

Events should have only two arguments

Events should have only two arguments:
an Object argument named sender,
which represents the the object that's raising the event;
and an argument named e,
which exposes teh event's arguments throught its fields or properties. This second
argument should be a System.EventsArgs object or an object whose class inherits from
the System.EventsArg (The name of such a class should end with EventsArgs.)
This naming convention requires only a little extra code today, but it might simplify
your job a great deal tommorrow.

Friend Sub NewAgreement()
RaiseEvent CreateNew(Me, New System.EventArgs)
End Sub

No comments: