HighlightParam.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 HighlightParam:AnnotParam
  9. {
  10. public HighlightParam()
  11. {
  12. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT;
  13. }
  14. public byte[] HighlightColor { get; set; }
  15. public List<CRect> QuardRects { get; set; }
  16. public override bool CopyTo(AnnotParam transfer)
  17. {
  18. HighlightParam highlightTransfer = transfer as HighlightParam;
  19. if (highlightTransfer == null)
  20. {
  21. return false;
  22. }
  23. if (!base.CopyTo(highlightTransfer))
  24. {
  25. return false;
  26. }
  27. if(HighlightColor!=null )
  28. {
  29. highlightTransfer.HighlightColor = (byte[])HighlightColor.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. highlightTransfer.QuardRects = rectList;
  39. }
  40. return true;
  41. }
  42. }
  43. }