UnderlineParam.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using ComPDFKit.Import;
  2. using ComPDFKit.PDFAnnotation;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. using System.Windows.Media;
  6. namespace ComPDFKit.Tool
  7. {
  8. public class UnderlineParam:AnnotParam
  9. {
  10. public UnderlineParam ()
  11. {
  12. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE;
  13. }
  14. public byte[] UnderlineColor { get; set; }
  15. public List<CRect> QuardRects { get; set; }
  16. public override bool CopyTo(AnnotParam transfer)
  17. {
  18. UnderlineParam underlineTransfer = transfer as UnderlineParam;
  19. if (underlineTransfer == null)
  20. {
  21. return false;
  22. }
  23. if (!base.CopyTo(underlineTransfer))
  24. {
  25. return false;
  26. }
  27. if(UnderlineColor != null)
  28. {
  29. underlineTransfer.UnderlineColor = (byte[])UnderlineColor.Clone();
  30. }
  31. if (QuardRects != null)
  32. {
  33. List<CRect> rectList = new List<CRect>();
  34. foreach (CRect saveRect in QuardRects)
  35. {
  36. rectList.Add(saveRect);
  37. }
  38. underlineTransfer.QuardRects = rectList;
  39. }
  40. return true;
  41. }
  42. }
  43. }