Ejemplo n.º 1
0
 public SheetReader(Stream sheetXmlStream, XslxSharedStringsStream xlsxSharedStringsStream,
                    XslxIsDateTimeStream xlsxIsDateTimeStream)
 {
     _xlsxSharedStringsStream = xlsxSharedStringsStream;
     _xlsxIsDateTimeStream    = xlsxIsDateTimeStream;
     _values    = new Dictionary <string, object>();
     _xmlReader = XmlReader.Create(sheetXmlStream);
     GetDimension();
 }
 private void Initialize()
 {
     _archive = new ZipArchive(_fileStream, ZipArchiveMode.Read);
     //CSH 28012020 - We order by the length of the name string then by the name itself, so that Sheet10 appears immediately
     //after Sheet9 rather than after Sheet1
     _worksheetEntries = _archive.Entries.Where(x => x.FullName.StartsWith("xl/worksheets/sheet"))
                         .OrderBy(x => x.Name.Length)
                         .ThenBy(x => x.Name)
                         .ToArray();
     SharedStringsStream =
         new XslxSharedStringsStream(
             _archive.Entries.First(x => x.FullName.EndsWith("sharedStrings.xml")).Open());
     IsDateTimeStream =
         new XslxIsDateTimeStream(_archive.Entries.First(x => x.FullName.EndsWith("styles.xml")).Open());
 }