//protected virtual void Dispose(bool disposing) private void Dispose(bool disposing) { if (disposing) { var readers = new List <XmlReader>(); readers.Add(_sharedStringsReader); readers.AddRange(_sheetReaders.Values); readers.AddRange(_sheetRelsReaders.Values); readers.AddRange(_commentsReaders.Values); foreach (var reader in readers) { if (reader != null) { reader.Close(); } } } _sheetRelsIds = null; _sheetNames = null; _sheetPaths = null; _sharedStringsReader = null; _sheetReaders = null; _commentsReaders = null; _sharedStrings = null; _sheetReader = null; isClosed = true; }
private XlsxReader() { _sheetRelsIds = new List <string>(); _sheetNames = new List <string>(); _sheetPaths = new Dictionary <string, string>(); _sheetStreams = new Dictionary <string, Stream>(); _sheetReaders = new XmlReaderMap(); _sheetRelsReaders = new XmlReaderMap(); _commentsReaders = new XmlReaderMap(); _sharedStrings = new List <string>(); }