TextBoxParam.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using ComPDFKit.PDFAnnotation;
  2. using ComPDFKit.PDFAnnotation.Form;
  3. using System.Windows;
  4. namespace ComPDFKit.Tool
  5. {
  6. public class TextBoxParam:WidgetParm
  7. {
  8. public TextBoxParam ()
  9. {
  10. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
  11. WidgetType = C_WIDGET_TYPE.WIDGET_TEXTFIELD;
  12. }
  13. public string Text { get; set; } = string.Empty;
  14. public bool IsMultiLine { get; set; }
  15. public bool IsPassword { get; set; }
  16. public bool IsItalic { get; set; }
  17. public bool IsBold { get; set; }
  18. public C_TEXT_ALIGNMENT Alignment { get; set; }
  19. public override bool CopyTo(AnnotParam transfer)
  20. {
  21. TextBoxParam textTransfer = transfer as TextBoxParam;
  22. if (textTransfer == null)
  23. {
  24. return false;
  25. }
  26. if (!base.CopyTo(textTransfer))
  27. {
  28. return false;
  29. }
  30. textTransfer.Text = Text;
  31. textTransfer.IsMultiLine = IsMultiLine;
  32. textTransfer.IsPassword = IsPassword;
  33. textTransfer.IsItalic = IsItalic;
  34. textTransfer.IsBold = IsBold;
  35. textTransfer.Alignment = Alignment;
  36. return true;
  37. }
  38. }
  39. }