private void btnLoad_Click(object sender, RoutedEventArgs e) { var dialog = new OpenFileDialog(); dialog.FileName = "Document"; dialog.DefaultExt = ".xlsx"; dialog.Filter = "XLSX documents (.xlsx)|*.xlsx"; var result = dialog.ShowDialog(); if (result == true) { _reader = new XLSXReader(dialog.FileName); sldSheetNum.Maximum = _reader.SheetsCount; SetSaveVisibility(true); } }
/// <summary> /// Excel文件 /// </summary> /// <param name="tables"></param> public ExcelFile(DataTableCollection tables) { m_sheets = new Dictionary <string, WorkSheet>(); int i = 0; int count = tables.Count; XLSXReader.Log(">>>[1] Tabel Count: " + tables.Count); while (i < count) { WorkSheet sheet = new WorkSheet(tables[i], i); m_sheets[sheet.name] = sheet; i++; } }