SquigglyParam.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 SquigglyParam:AnnotParam
  9. {
  10. public SquigglyParam ()
  11. {
  12. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY;
  13. }
  14. public byte[] SquigglyColor { get; set; }
  15. public List<CRect> QuardRects { get; set; }
  16. public override bool CopyTo(AnnotParam transfer)
  17. {
  18. SquigglyParam squigglyTransfer = transfer as SquigglyParam;
  19. if (squigglyTransfer == null)
  20. {
  21. return false;
  22. }
  23. if (!base.CopyTo(squigglyTransfer))
  24. {
  25. return false;
  26. }
  27. squigglyTransfer.SquigglyColor = SquigglyColor;
  28. if(SquigglyColor!=null)
  29. {
  30. squigglyTransfer.SquigglyColor= (byte[])SquigglyColor.Clone();
  31. }
  32. if (QuardRects != null)
  33. {
  34. List<CRect> rectList = new List<CRect>();
  35. foreach (CRect saveRect in QuardRects)
  36. {
  37. rectList.Add(saveRect);
  38. }
  39. squigglyTransfer.QuardRects = rectList;
  40. }
  41. return true;
  42. }
  43. }
  44. }