public void CreateNewStreamWriter(FileDto fileDto) { CloseStreamWriter(); _swDto = new StreamWriterDto(_currentLogfileDto); }
protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!_disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { // Dispose managed resources. if (_swDto != null) { _swDto.GetStreamWriter().Flush(); _swDto.Close(); _swDto = null; } if (_defautlLogFileDto != null) { _defautlLogFileDto.Dispose(); _defautlLogFileDto = null; } if (_currentLogfileDto != null) { _currentLogfileDto.Dispose(); _currentLogfileDto = null; } } // Note disposing has been done. _disposed = true; } }
public void CloseStreamWriter() { if (_swDto == null) { return; } _swDto.Close(); _swDto = null; }