I'm using JdSoft's APNS-Sharp library in my ASP.NET web app. The library is written in C#, and makes extensive use of Delegate Functions and Events for threading purposes. My application is written in VB.NET, and I'm a little confused on about how to translate the following sample code (C#):
....
//Wireup the events
service.Error += new FeedbackService.OnError(service_Error);
....
}
static void service_Error(object sender, Exception ex)
{
Console.WriteLine(...);
}
Here are the relevant members of the FeedbackService class:
public delegate void OnError(object sender, Exception ex);
public event OnError Error;
Basically, I'm trying to figure out how to attach a function (like service_Error) to an event (like Error) in VB.NET. I'm unclear on what the += syntax means in this context, and VisualStudio says that the 'Error' event cannot be accessed directly by my VB.NET code for some reason.