public static void UndoSheetInfo(Worksheet sheet, CopyMoveSheetInfo sheetInfo) { if (sheetInfo.IsDefaultStyleSaved()) { sheet.DefaultStyle = sheetInfo.GetDefaultStyle(); } if (sheetInfo.IsDefaultColumnWidthSaved()) { sheet.DefaultColumnWidth = sheetInfo.GetDefaultColumnWidth(); } if (sheetInfo.IsDefaultRowHeightSaved()) { sheet.DefaultRowHeight = sheetInfo.GetDefaultRowHeight(); } if (sheetInfo.IsColumnHeaderDefaultStyleSaved()) { sheet.ColumnHeader.DefaultStyle = sheetInfo.GetColumnHeaderDefaultStyle(); } if (sheetInfo.IsColumnHeaderDefaultRowHeightSaved()) { sheet.ColumnHeader.DefaultRowHeight = sheetInfo.GetColumnHeaderDefaultRowHeight(); } if (sheetInfo.IsRowHeaderDefaultStyleSaved()) { sheet.RowHeader.DefaultStyle = sheetInfo.GetRowHeaderDefaultStyle(); } if (sheetInfo.IsRowHeaderDefaultColumnWidthSaved()) { sheet.RowHeader.DefaultColumnWidth = sheetInfo.GetRowHeaderDefaultColumnWidth(); } }
public static void SaveSheetInfo(Worksheet sheet, CopyMoveSheetInfo sheetInfo, CopyToOption option) { if ((option & CopyToOption.Style) > ((CopyToOption)0)) { sheetInfo.SaveDefaultStyle(sheet.DefaultStyle); sheetInfo.SaveColumnHeaderDefaultStyle(sheet.ColumnHeader.DefaultStyle); sheetInfo.SaveRowHeaderDefaultStyle(sheet.RowHeader.DefaultStyle); } sheetInfo.SaveDefaultColumnWidth(sheet.DefaultColumnWidth); sheetInfo.SaveDefaultRowHeight(sheet.DefaultRowHeight); sheetInfo.SaveColumnHeaderDefaultRowHeight(sheet.ColumnHeader.DefaultRowHeight); sheetInfo.SaveRowHeaderDefaultColumnWidth(sheet.RowHeader.DefaultColumnWidth); }