private void RaiseStopped(Exception exception) { if (Stopped != null) { var e = new RecordingStoppedEventArgs(exception); if (_synchronizationContext != null) { _synchronizationContext.Post(o => Stopped(this, e), null); //use post instead of send to avoid deadlocks } else { Stopped(this, e); } } }
private void RaiseStopped(Exception exception) { EventHandler <RecordingStoppedEventArgs> handler = this.Stopped; if (handler != null) { var e = new RecordingStoppedEventArgs(exception); if (_synchronizationContext != null) { _synchronizationContext.Post(o => handler(this, e), null); //use post instead of send to avoid deadlocks } else { handler(this, e); } } }
private void RaiseStopped(Exception exception) { if (Stopped != null) { var e = new RecordingStoppedEventArgs(exception); if(_synchronizationContext != null) _synchronizationContext.Post(o => Stopped(this, e), null); //use post instead of send to avoid deadlocks else Stopped(this, e); } }
private void RaiseStopped(Exception exception) { EventHandler<RecordingStoppedEventArgs> handler = this.Stopped; if (handler != null) { var e = new RecordingStoppedEventArgs(exception); if(_synchronizationContext != null) _synchronizationContext.Post(o => handler(this, e), null); //use post instead of send to avoid deadlocks else handler(this, e); } }