SectionTables.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using FastReport.Export.Dxf.Sections.Tables;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace FastReport.Export.Dxf.Sections
  5. {
  6. public class SectionTables : Section
  7. {
  8. #region Private Fields
  9. private List<TableBase> tables;
  10. #endregion Private Fields
  11. #region Public Properties
  12. public TableLtype Ltype
  13. {
  14. get
  15. {
  16. foreach (TableBase t in Tables)
  17. {
  18. if (t.Name == "LTYPE" && t.GetType() == typeof(TableLtype))
  19. return (TableLtype)t;
  20. }
  21. // else
  22. TableLtype ltype = new TableLtype();
  23. Tables.Add(ltype);
  24. return ltype;
  25. }
  26. set
  27. {
  28. for (int i = 0; i < Tables.Count; i++)
  29. {
  30. TableBase t = Tables[i];
  31. if (t.Name == "LTYPE")
  32. t = value;
  33. }
  34. }
  35. }
  36. public List<TableBase> Tables
  37. {
  38. get { return tables; }
  39. set { tables = value; }
  40. }
  41. #endregion Public Properties
  42. #region Public Constructors
  43. public SectionTables() : base("TABLES")
  44. {
  45. Tables = new List<TableBase>();
  46. }
  47. #endregion Public Constructors
  48. #region Public Methods
  49. public override void AppendTo(StringBuilder s)
  50. {
  51. StartSectionAppendTo(s);
  52. s.Append("\n");
  53. foreach (TableBase t in Tables)
  54. {
  55. t.AppendTo(s);
  56. s.Append("\n");
  57. }
  58. EndSectionAppendTo(s);
  59. }
  60. #endregion Public Methods
  61. }
  62. }