Пример #1
0
 public void Dispose()
 {
     if (DisposalInterlock.Enter())
     {
         OnDisposing?.Invoke();
         DisposeManaged();
     }
 }
Пример #2
0
 protected virtual void CallDisposeMethods(bool Disposing)
 {
     if (Disposing)
     {
         OnDisposing?.Invoke();
         DisposeManaged();
     }
 }
Пример #3
0
 public void Dispose()
 {
     if (!disposed)
     {
         OnDisposing?.Invoke(this, new EventArgs());
         disposed = true;
     }
 }
Пример #4
0
 /// <summary>
 /// 释放资源
 /// </summary>
 public void Dispose()
 {
     OnDisposing?.Invoke();
     Close();
     timer?.Dispose();
     nodeWatchers?.Clear();
     are?.Dispose();
     GC.Collect();
 }
Пример #5
0
        public void Dispose()
        {
            if (Stream != null)
            {
                Stream.Close();
                Stream = null;

                OnDisposing?.Invoke();
            }
        }
Пример #6
0
        public void Dispose()
        {
            if (InnerRequest != null)
            {
                OnDisposing?.Invoke();

                InnerRequest.OnFinished -= OnHttpResponse;
                InnerRequest.Response?.Dispose();
                InnerRequest = null;
            }
        }
 /// <summary>
 ///     Releases unmanaged and - optionally - managed resources.
 /// </summary>
 public override void Dispose()
 {
     try
     {
         OnDisposing?.Invoke(this, new OnDisposingEventArgs(this));
     }
     finally
     {
         base.Dispose();
         Container.Dispose();
         if (OnDisposing != null)
         {
             OnDisposing -= OnDisposing;
         }
     }
 }
Пример #8
0
 protected override void Dispose(bool disposing)
 {
     OnDisposing?.Invoke(this);
     base.Dispose(disposing);
     ServiceProvider.TryDispose();
 }
Пример #9
0
 /// <summary>
 /// Disposes the list and, perhaps, compacts the underlying list.
 /// </summary>
 public void Dispose()
 {
     OnDisposing?.Invoke(startIncl, endExcl);
 }
Пример #10
0
 public override void Dispose()
 {
     OnDisposing?.Invoke();
 }