public virtual void OnInformationDownload(EventArguments e) { if (InformationDownloadEvent != null) { InformationDownloadEvent(this, e); } }
void w_InformationDownloadEvent(object o, EventArguments e) { if (labelDetailedInformation.InvokeRequired) { labelDetailedInformation.Invoke(new Action(() => labelDetailedInformation.Text = e.Name + " " + e.Details + " at " + e.Date.ToLocalTime())); } else { labelDetailedInformation.Text = e.Name + " " + e.Details + " at " + e.Date.ToLocalTime(); // runs on UI thread } }