private void OnProgressChanged(ThreadProgressChangedEventArgs args) { if (ProgressChanged == null) { return; } try { SendEvent(ProgressChanged.GetInvocationList(), new object[] { this, args }); } catch { } }
public void ReportProgress(int percent) { if (_isProgressReported == false) { throw new InvalidOperationException("Job does not report its progress"); } object[] e = new object[] { this, new ProgressChangedEventArgs(percent, null) }; foreach (Delegate handler in ProgressChanged.GetInvocationList()) { InvokeDelegate(handler, e); } }