A
active
Because of a strong recommendation I saw in this NG all my events are of the
form:
Public Event HeightChanged(ByVal sender As Object, ByVal e As
HeightChangeEventArgs)
where:
Public NotInheritable Class HeightChangeEventArgs
Inherits EventArgs
....
I always wondered about the need for that format and figured I'd look into
it someday.
Today I saw an advanced vb.Net book that used events like:
Public Event HeightChanged(zz As String)
Is there any reason to prefer the first form over the second? After all I
define other methods with any signature that I like. I can think of no
reason to send Sender if the consumer knows a head of time who the sender
must be. And more importantly, having to maintain a class when String would
do.
I'd appreciate any comments relating to this.
In particular, do you always follow the stated convention?
Thanks
form:
Public Event HeightChanged(ByVal sender As Object, ByVal e As
HeightChangeEventArgs)
where:
Public NotInheritable Class HeightChangeEventArgs
Inherits EventArgs
....
I always wondered about the need for that format and figured I'd look into
it someday.
Today I saw an advanced vb.Net book that used events like:
Public Event HeightChanged(zz As String)
Is there any reason to prefer the first form over the second? After all I
define other methods with any signature that I like. I can think of no
reason to send Sender if the consumer knows a head of time who the sender
must be. And more importantly, having to maintain a class when String would
do.
I'd appreciate any comments relating to this.
In particular, do you always follow the stated convention?
Thanks