Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
        public ExcelOpenXmlReader(Stream stream)
        {
            Document = new ZipWorker(stream);
            Workbook = new XlsxWorkbook(Document);

            // By default, the data reader is positioned on the first result.
            Reset();
        }
Ejemplo n.º 4
0
        public override void Close()
        {
            base.Close();

            Document?.Dispose();
            Workbook = null;
            Document = null;
        }
Ejemplo n.º 5
0
        public void Initialize(System.IO.Stream fileStream)
        {
            try {
                _zipWorker = new ZipWorker();
                _zipWorker.Open(fileStream);

                ReadGlobals();
            } catch (Exception ex) {
                _isValid          = false;
                _exceptionMessage = ex.Message;

                Close();
            }
        }
Ejemplo n.º 6
0
 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();
     }
 }
Ejemplo n.º 7
0
        public void Initialize(System.IO.Stream fileStream)
        {
            _zipWorker = new ZipWorker();
            _zipWorker.Extract(fileStream);

            if (!_zipWorker.IsValid)
            {
                _isValid          = false;
                _exceptionMessage = _zipWorker.ExceptionMessage;

                Close();

                return;
            }

            ReadGlobals();
        }