/// <summary> /// Actually disposes the current object. /// </summary> /// <param name="disposing"> /// Indicates whether the method was invoked from the <see cref="IDisposable.Dispose"/> /// implementation or from the finalizer /// </param> private void Dispose(bool disposing) { if (disposing && _writer != null) { _writer.Dispose(); } }
/// <summary> /// Actually disposes the current object. /// </summary> /// <param name="disposing"> /// Indicates whether the method was invoked from the <see cref="IDisposable.Dispose"/> /// implementation or from the finalizer /// </param> protected virtual void Dispose(bool disposing) { if (disposing && _writer != null) { if (_buffer.Count > 0) { WriteRecord(_sum.Sum(_buffer)); } _writer.Dispose(); } }
public void Dispose() { if (_disposed) { return; } _recordReader?.Dispose(); _recordWriter?.Dispose(); _disposed = true; }