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