internal void OnError(IBackgroundCopyError err) { System.IO.ErrorEventHandler temp = ErrorHandler; if (temp != null) { temp(this, new System.IO.ErrorEventArgs(new BackgroundCopyException(err))); } }
/// <summary> /// Raises the <see cref="Error"/> event. /// </summary> /// <param name="e">The <see cref="Exception"/> which occured while watching the registry.</param> /// <remarks> /// <p> /// <b>OnError</b> is called when an exception occurs while watching the registry. /// </p> /// <note type="inheritinfo"> /// When overriding <see cref="OnError"/> in a derived class, be sure to call /// the base class's <see cref="OnError"/> method. /// </note> /// </remarks> protected virtual void OnError(System.Exception e) { System.IO.ErrorEventHandler handler = Error; if (handler != null) { handler(this, new System.IO.ErrorEventArgs(e)); } }
private void InvokeHandler(ErrorEventHandler eventHandler, ErrorEventArgs e) { if (eventHandler != null) { if (_containedFSW.SynchronizingObject != null && this._containedFSW.SynchronizingObject.InvokeRequired) { _containedFSW.SynchronizingObject.BeginInvoke(eventHandler, new object[] { this, e }); } else { eventHandler(this, e); } } }