PolyLineMeasureParam.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using ComPDFKit.Import;
  2. using ComPDFKit.Measure;
  3. using ComPDFKit.PDFAnnotation;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Media;
  10. namespace ComPDFKit.Tool
  11. {
  12. public class PolyLineMeasureParam : AnnotParam
  13. {
  14. public PolyLineMeasureParam()
  15. {
  16. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE;
  17. }
  18. public byte[] LineColor { get; set; }
  19. public float LineWidth { get; set; }
  20. public float[] LineDash { get; set; }
  21. public List<CPoint> SavePoints { get; set; }
  22. public string FontName { get; set; }
  23. public double FontSize { get; set; }
  24. public byte[] FontColor { get; set; }
  25. public bool IsBold { get; set; }
  26. public bool IsItalic { get; set; }
  27. public C_BORDER_STYLE BorderStyle { get; set; }
  28. public CPDFMeasureInfo measureInfo { get; set; }
  29. public override bool CopyTo(AnnotParam transfer)
  30. {
  31. PolyLineMeasureParam polygonTransfer = transfer as PolyLineMeasureParam;
  32. if (polygonTransfer == null)
  33. {
  34. return false;
  35. }
  36. if (!base.CopyTo(polygonTransfer))
  37. {
  38. return false;
  39. }
  40. if (LineColor != null)
  41. {
  42. polygonTransfer.LineColor = (byte[])LineColor.Clone();
  43. }
  44. if (LineDash != null)
  45. {
  46. polygonTransfer.LineDash = (float[])LineDash.Clone();
  47. }
  48. if (SavePoints != null)
  49. {
  50. polygonTransfer.SavePoints.CopyTo(SavePoints.ToArray());
  51. }
  52. if (FontColor != null)
  53. {
  54. polygonTransfer.FontColor = (byte[])FontColor.Clone();
  55. }
  56. if (measureInfo != null)
  57. {
  58. CPDFMeasureInfo cPDFMeasureInfo = new CPDFMeasureInfo()
  59. {
  60. Factor = measureInfo.Factor,
  61. Unit = measureInfo.Unit,
  62. DecimalSymbol = measureInfo.DecimalSymbol,
  63. ThousandSymbol = measureInfo.ThousandSymbol,
  64. Display = measureInfo.Display,
  65. Precision = measureInfo.Precision,
  66. UnitPrefix = measureInfo.UnitPrefix,
  67. UnitSuffix = measureInfo.UnitSuffix,
  68. UnitPosition = measureInfo.UnitPosition,
  69. RulerBase = measureInfo.RulerBase,
  70. RulerBaseUnit = measureInfo.RulerBaseUnit,
  71. RulerTranslateUnit = measureInfo.RulerTranslateUnit,
  72. CaptionType = measureInfo.CaptionType,
  73. RulerTranslate= measureInfo.RulerTranslate,
  74. };
  75. polygonTransfer.measureInfo = cPDFMeasureInfo;
  76. }
  77. polygonTransfer.LineWidth = LineWidth;
  78. polygonTransfer.FontName = FontName;
  79. polygonTransfer.FontSize = FontSize;
  80. polygonTransfer.IsBold = IsBold;
  81. polygonTransfer.IsItalic = IsItalic;
  82. polygonTransfer.BorderStyle = BorderStyle;
  83. return true;
  84. }
  85. }
  86. }