public override void Insert(int index, IExcelSheet item) { if (item is ExcelSheetNpoi) { var newSheet = (ExcelSheetNpoi)item.Copy(this); ExcelBookNpoi.SetSheetOrder(newSheet.Name, index); } else { throw new Exception($"{item}不是通过Npoi实现的工作表"); } }
public override void Insert(int index, IExcelSheet item) { item.Copy(this); Sheets.MoveBefore(Count - 1, index); }