What is the equivalent for the Handler clause in C #?

1

I'm following this tutorial to try to make Skype automatically accept lost friendships. The tutorial is in VB and I have to translate code for C # the problem is when I got the part of handler , I tried to translate the following code:

Private Sub auoAdd(uName As Skype4comlib.user) Handles Skype1.UserAuthorizationRequestReceived

End Sub

In this site it ignores the Handles clause, does anyone know how to write the handler part above for C #?

    
asked by anonymous 25.09.2016 / 14:44

1 answer

2

C # works differently compared to VB.NET. Add the following at the start of your class:

Skype1.UserAuthorizationRequestReceived += auoAdd;

Where auoAdd is the method that triggers the event, it will execute and Skype1.UserAuthorizationRequestReceived is the event. The equivalent of this in VB.NET is the AddHandler statement.

The auoAdd method will look like this:

public void auoAdd(uName As Skype4comlib.user)
{
    // Seu código
}
    
25.09.2016 / 17:06