PushButtonParam.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using ComPDFKit.Import;
  2. using ComPDFKit.PDFAnnotation;
  3. using ComPDFKit.PDFAnnotation.Form;
  4. using ComPDFKit.PDFDocument.Action;
  5. using System.Windows;
  6. namespace ComPDFKit.Tool
  7. {
  8. public class PushButtonParam:WidgetParm
  9. {
  10. public PushButtonParam ()
  11. {
  12. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
  13. WidgetType = C_WIDGET_TYPE.WIDGET_PUSHBUTTON;
  14. }
  15. public bool IsBold { get; set; }
  16. public bool IsItalic { get; set; }
  17. public string Text { get; set; } = string.Empty;
  18. public string Uri { get; set; } = string.Empty;
  19. public int DestinationPageIndex { get; set; }
  20. public CPoint DestinationPosition { get; set; }
  21. public C_ACTION_TYPE Action { get; set; }
  22. public override bool CopyTo(AnnotParam transfer)
  23. {
  24. PushButtonParam pushbuttonTransfer = transfer as PushButtonParam;
  25. if (pushbuttonTransfer == null)
  26. {
  27. return false;
  28. }
  29. if (!base.CopyTo(pushbuttonTransfer))
  30. {
  31. return false;
  32. }
  33. pushbuttonTransfer.IsBold = IsBold;
  34. pushbuttonTransfer.IsItalic = IsItalic;
  35. pushbuttonTransfer.Text = Text;
  36. pushbuttonTransfer.Uri = Uri;
  37. pushbuttonTransfer.DestinationPageIndex = DestinationPageIndex;
  38. pushbuttonTransfer.DestinationPosition = DestinationPosition;
  39. pushbuttonTransfer.Action = Action;
  40. return true;
  41. }
  42. }
  43. }