示例#1
0
        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();
 }