Beispiel #1
0
 /// <summary>
 /// Closes the package.
 /// </summary>
 public void Dispose()
 {
     if (_package != null)
     {
         if (_isExternalStream == false && _stream != null && (_stream.CanRead || _stream.CanWrite))
         {
             _stream.Close();
         }
         CloseStream();
         _package.Close();
         if (_isExternalStream == false)
         {
             ((IDisposable)_stream).Dispose();
         }
         if (_workbook != null)
         {
             _workbook.Dispose();
         }
         _package  = null;
         _images   = null;
         _file     = null;
         _workbook = null;
         _stream   = null;
         _workbook = null;
         GC.Collect();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Closes the package.
 /// </summary>
 public void Dispose()
 {
     if (_package != null)
     {
         if (Stream != null && (Stream.CanRead || Stream.CanWrite))
         {
             Stream.Close();
         }
         _package.Close();
         ((IDisposable)_stream).Dispose();
         ((IDisposable)_workbook).Dispose();
         _package  = null;
         _images   = null;
         _file     = null;
         _workbook = null;
         _stream   = null;
         _workbook = null;
     }
 }
Beispiel #3
0
 /// <summary>
 /// Closes the package.
 /// </summary>
 public void Dispose()
 {
     if (_package != null)
     {
         if (_isExternalStream == false && _stream != null && (_stream.CanRead || _stream.CanWrite))
         {
             CloseStream();
         }
         _package.Close();
         if (_workbook != null)
         {
             _workbook.Dispose();
         }
         _package  = null;
         File      = null;
         _workbook = null;
         _stream   = null;
         _workbook = null;
         GC.Collect();
     }
 }