private void MonitorEvent_UpdateStatus(object sender, StatusEventArgs e) { if (this.InvokeRequired) { this.BeginInvoke(new EventHandler<StatusEventArgs>(MonitorEvent_UpdateStatus), new object[] { sender, e }); return; } AddNewItemToLog(string.Format("Status: {0}", e.Status)); }
// Events private void UpdateStatusEvent(string status) { if (OnUpdateStatus == null) return; StatusEventArgs args = new StatusEventArgs(status); OnUpdateStatus(this, args); }