private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { if (disposing) { if (_xmlReader != null) { ((IDisposable)_xmlReader).Dispose(); } if (_sheetStream != null) { _sheetStream.Dispose(); } if (_zipWorker != null) { _zipWorker.Dispose(); } } _zipWorker = null; _xmlReader = null; _sheetStream = null; _workbook = null; _cellsValues = null; _savedCellsValues = null; disposed = true; } }
private void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { if (this._xmlReader != null) { this._xmlReader.Dispose(); } if (this._sheetStream != null) { this._sheetStream.Dispose(); } if (this._zipWorker != null) { this._zipWorker.Dispose(); } } this._zipWorker = null; this._xmlReader = null; this._sheetStream = null; this._workbook = null; this._cellsValues = null; this._savedCellsValues = null; this.disposed = true; } }
public ExcelOpenXmlReader(Stream stream) { Document = new ZipWorker(stream); Workbook = new XlsxWorkbook(Document); // By default, the data reader is positioned on the first result. Reset(); }
public override void Close() { base.Close(); Document?.Dispose(); Workbook = null; Document = null; }
public void Initialize(System.IO.Stream fileStream) { try { _zipWorker = new ZipWorker(); _zipWorker.Open(fileStream); ReadGlobals(); } catch (Exception ex) { _isValid = false; _exceptionMessage = ex.Message; Close(); } }
public void Initialize(Stream fileStream) { this._zipWorker = new ZipWorker(); this._zipWorker.Extract(fileStream); if (!this._zipWorker.IsValid) { this._isValid = false; this._exceptionMessage = this._zipWorker.ExceptionMessage; this.Close(); } else { this.ReadGlobals(); } }
public void Initialize(System.IO.Stream fileStream) { _zipWorker = new ZipWorker(); _zipWorker.Extract(fileStream); if (!_zipWorker.IsValid) { _isValid = false; _exceptionMessage = _zipWorker.ExceptionMessage; Close(); return; } ReadGlobals(); }