Exemplo n.º 1
0
        protected virtual void Dispose(bool finalize)
        {
            if (_isDisposed)
            {
                return;
            }

            if (_streamWriter != null)
            {
                _writer.Dispose(_streamWriter.Value);
            }

            _isDisposed = true;
            if (_closeStreamOnDispose)
            {
                if (_streamWriter != null)
                {
                    _streamWriter.Value.Dispose();
                }
            }
            else
            {
                if (_streamWriter != null)
                {
                    _streamWriter.Value.Flush();
                }
            }

            if (!finalize)
            {
                GC.SuppressFinalize(this);
            }
        }
Exemplo n.º 2
0
        protected virtual void Dispose(bool finalize)
        {
            if (_isDisposed)
                return;

            _writer.Dispose(_streamWriter);

            _isDisposed = true;
            if (_closeStreamOnDispose)
            {
                if (_streamWriter != null)
                    _streamWriter.Dispose();
            }
            else
            {
                if (_streamWriter != null)
                    _streamWriter.Flush();
            }

            if (!finalize)
                GC.SuppressFinalize(this);
        }