I've written a library which handles all the TCP/IP comms with our custom embedded hardware. It is used with most of our in house software and in the future could possibly be sold separately.
The most annoying thing this is that every time I handle events from the library, I have to have a seperate function to invoke through. I can only imagine that there is an easier way to do this that I just dont know...
Any ideas?
public Setup(DiscoveryReader reader)
{
download = new DownloadFilesIndividual(Reader.ip, DateTime.Today);
download.OnDownloadStatus += new DownloadStatusHandler(download_OnDownloadStatus);
}
void download_OnDownloadStatus(DownloadStatus status)
{
Invoke(new DownloadStatusHandler(this.safe_download_OnDownloadStatus), new object[] { status });
}
void safe_download_OnDownloadStatus(DownloadStatus status)
{
// Do UI stuff here
}