LineParam.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using ComPDFKit.Import;
  2. using ComPDFKit.PDFAnnotation;
  3. using System.Windows;
  4. using System.Windows.Media;
  5. namespace ComPDFKit.Tool
  6. {
  7. public class LineParam:AnnotParam
  8. {
  9. public LineParam ()
  10. {
  11. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_LINE;
  12. }
  13. public byte[] LineColor { get; set; }
  14. public byte[] BgColor { get; set; }
  15. public bool HasBgColor { get; set; }
  16. public double LineWidth { get; set; }
  17. public float[] LineDash { get; set; }
  18. public C_BORDER_STYLE BorderStyle { get; set; }
  19. public C_LINE_TYPE HeadLineType { get; set; }
  20. public C_LINE_TYPE TailLineType { get; set; }
  21. public CPoint HeadPoint { get; set; }
  22. public CPoint TailPoint { get; set; }
  23. public override bool CopyTo(AnnotParam transfer)
  24. {
  25. LineParam lineTransfer = transfer as LineParam;
  26. if (lineTransfer == null)
  27. {
  28. return false;
  29. }
  30. if (!base.CopyTo(lineTransfer))
  31. {
  32. return false;
  33. }
  34. if (LineColor!=null)
  35. {
  36. lineTransfer.LineColor = (byte[])LineColor.Clone();
  37. }
  38. if(BgColor!=null)
  39. {
  40. lineTransfer.BgColor = (byte[])BgColor.Clone();
  41. }
  42. if(LineDash!=null)
  43. {
  44. lineTransfer.LineDash = (float[])LineDash.Clone();
  45. }
  46. lineTransfer.HasBgColor = HasBgColor;
  47. lineTransfer.LineWidth = LineWidth;
  48. lineTransfer.BorderStyle = BorderStyle;
  49. lineTransfer.HeadLineType = HeadLineType;
  50. lineTransfer.TailLineType = TailLineType;
  51. lineTransfer.HeadPoint = HeadPoint;
  52. lineTransfer.TailPoint = TailPoint;
  53. return true;
  54. }
  55. }
  56. }