TableStyleCollection.cs 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using FastReport.Utils;
  5. namespace FastReport.Table
  6. {
  7. internal class TableStyleCollection : FRCollectionBase
  8. {
  9. private TableCell defaultStyle;
  10. public TableCell DefaultStyle
  11. {
  12. get { return defaultStyle; }
  13. }
  14. public TableCell this[int index]
  15. {
  16. get { return List[index] as TableCell; }
  17. set { List[index] = value; }
  18. }
  19. public TableCell Add(TableCell style)
  20. {
  21. for (int i = 0; i < Count; i++)
  22. {
  23. if (this[i].Equals(style))
  24. return this[i];
  25. }
  26. TableCell newStyle = new TableCell();
  27. newStyle.Assign(style);
  28. List.Add(newStyle);
  29. return newStyle;
  30. }
  31. public TableStyleCollection() : base(null)
  32. {
  33. defaultStyle = new TableCell();
  34. }
  35. }
  36. }