Reputation: 209
I am nearly complete on converting vb.net code to c#. Unfortunately, I am having problems in converting the following code to c#.
Public Event SomeSub(ByVal sender As Object, ByVal e As System.EventArgs) Implements SomeLayer.ISomeInterface.SomeSub
Upvotes: 2
Views: 403
Reputation: 13976
It's just about implementing an interface event.
There's really no need to define a whole new delegate since the event complies to the "standard" EventHandler
signature (Object
and EventArgs
params).
public event EventHandler SomeSub;
You can then use it as:
instance.SomeSub += (s, e) => { //handle event here };
Upvotes: 0
Reputation: 11721
Try below code :-
public event SomeSubEventHandler SomeLayer.ISomeInterface.SomeSub;
public delegate void SomeSubEventHandler(object sender, System.EventArgs e);
For future conversion you can use some converter tools as linked below :-
Upvotes: 1