AsposeExcelModel.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using Aspose.Cells;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace Bowin.Common.Office
  6. {
  7. public enum HeaderAndFooterSection
  8. {
  9. Left = 0,
  10. Center = 1,
  11. Right = 2
  12. }
  13. public class HeaderAndFooterFormater
  14. {
  15. public HeaderAndFooterSection Section { get; set; }
  16. public Func<string, string> Formater { get; set; }
  17. }
  18. public class InsertColumnItem
  19. {
  20. public int ColumnIndex { get; set; }
  21. public int InsertCount { get; set; }
  22. }
  23. public class AsposeCellItem : CellItem
  24. {
  25. public Func<Workbook, Style> Style { get; set; }
  26. }
  27. public class AsposeListItem : ListItem
  28. {
  29. public AsposeListItem()
  30. {
  31. StyleList = new List<AsposeExcelCellStyle>();
  32. MergeList = new List<CellArea>();
  33. IsInsertRow = true;
  34. }
  35. public Dictionary<int?, int?> AutoHeightRowAndPx { get; set; }
  36. public bool IsInsertRow { get; set; }
  37. public List<AsposeExcelCellStyle> StyleList { get; set; }
  38. public List<CellArea> MergeList { get; set; }
  39. }
  40. public class AsposePageItem : PageItem
  41. {
  42. public AsposePageItem() : base()
  43. {
  44. MergeList = new List<CellArea>();
  45. InsertColumnItemList = new List<InsertColumnItem>();
  46. HeaderFormaterList = new List<HeaderAndFooterFormater>();
  47. FooterFormaterList = new List<HeaderAndFooterFormater>();
  48. ColumnSequenceList = new List<AsposePageColumnSequence>();
  49. FormularList = new List<AsposeCellItem>();
  50. }
  51. public List<InsertColumnItem> InsertColumnItemList { get; set; }
  52. public List<CellArea> MergeList { get; set; }
  53. public List<HeaderAndFooterFormater> HeaderFormaterList { get; set; }
  54. public List<HeaderAndFooterFormater> FooterFormaterList { get; set; }
  55. public List<AsposePageColumnSequence> ColumnSequenceList { get; set; }
  56. public List<AsposeCellItem> FormularList { get; set; }
  57. }
  58. public class AsposePageColumnSequence
  59. {
  60. public string ColumnName { get; set; }
  61. public List<string> SequenceList { get; set; }
  62. }
  63. public class AsposeCellStyle
  64. {
  65. public int? RowIndex;
  66. public int? ColIndex;
  67. public Style cellStyle;
  68. public AsposeCellStyle(int aColIndex, int aRowIndex, Style aCellStyle)
  69. {
  70. this.RowIndex = aRowIndex;
  71. this.ColIndex = aColIndex;
  72. this.cellStyle = aCellStyle;
  73. }
  74. }
  75. public class AsposeExcelCellPosition
  76. {
  77. /// <summary>
  78. /// 列序号,从0开始
  79. /// </summary>
  80. public int ColumnIndex { get; set; }
  81. /// <summary>
  82. /// 行序号,从0开始
  83. /// </summary>
  84. public int RowIndex { get; set; }
  85. }
  86. public class AsposeExcelCellStyle : AsposeExcelCellPosition
  87. {
  88. public Func<Workbook, Style> StyleFunc { get; set; }
  89. }
  90. }