public void TryDispose() { if (disposedValue) { return; } var eventArgs = new TryDisposeOrganizationServiceExtentedEventArgs(); TryingDispose?.Invoke(this, eventArgs); if (eventArgs.IsDisposingCanceled) { return; } this.Dispose(); }
private void service_TringDispose(object sender, TryDisposeOrganizationServiceExtentedEventArgs e) { e.PreventDispose(); }