Example #1
0
        protected virtual void Dispose(bool finalize)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;
            if (_writer != null && _textWriter != null)
            {
                _writer.EndWrite(_textWriter.Value);
            }

            if (_closeStreamOnDispose)
            {
                if (_textWriter != null)
                {
                    _textWriter.Value.Dispose();
                }
            }
            else
            {
                if (_textWriter != null)
                {
                    _textWriter.Value.Flush();
                }
            }

            if (!finalize)
            {
                GC.SuppressFinalize(this);
            }
        }
Example #2
0
        public void Dispose()
        {
            _writer.EndWrite(_textWriter);

            if (_closeStreamOnDispose)
            {
                _textWriter.Dispose();
            }
        }
Example #3
0
        public void Dispose()
        {
            if (_isDisposed)
            {
                return;
            }

            _writer.EndWrite(_textWriter);

            if (_closeStreamOnDispose)
            {
                _textWriter.Dispose();
            }
        }
Example #4
0
        public void Dispose()
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;
            if (_writer != null)
            {
                _writer.EndWrite(_textWriter);
            }

            if (_closeStreamOnDispose)
            {
                if (_textWriter != null)
                {
                    _textWriter.Dispose();
                }
            }
        }