FillDigitalSignatureDialog.xaml.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using ComPDFKit.PDFAnnotation.Form;
  2. using ComPDFKit.PDFDocument;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. namespace Compdfkit_Tools.PDFControl
  17. {
  18. /// <summary>
  19. /// Interaction logic for FillDigitalSignatureDialog.xaml
  20. /// </summary>
  21. public partial class FillDigitalSignatureDialog : Window
  22. {
  23. private string _filePath = string.Empty;
  24. public string FilePath
  25. {
  26. get => _filePath;
  27. set
  28. {
  29. _filePath = value;
  30. FillDigitalSignatureControl.SignaturePath = value;
  31. }
  32. }
  33. private string _password = string.Empty;
  34. public string Password
  35. {
  36. get => _password;
  37. set
  38. {
  39. _password = value;
  40. FillDigitalSignatureControl.Password = value;
  41. }
  42. }
  43. private CPDFSignatureWidget _signatureWidget;
  44. public CPDFSignatureWidget SignatureWidget
  45. {
  46. get => this._signatureWidget;
  47. set
  48. {
  49. this._signatureWidget = value;
  50. FillDigitalSignatureControl.signatureWidget = value;
  51. }
  52. }
  53. private CPDFDocument _document;
  54. public CPDFDocument Document
  55. {
  56. get => _document;
  57. set
  58. {
  59. _document = value;
  60. FillDigitalSignatureControl.Document = value;
  61. }
  62. }
  63. public event EventHandler<string> AfterFillSignature;
  64. public FillDigitalSignatureDialog()
  65. {
  66. InitializeComponent();
  67. FillDigitalSignatureControl.AfterFillSignature -= ReloadAfterFillSignature;
  68. FillDigitalSignatureControl.AfterFillSignature += ReloadAfterFillSignature;
  69. }
  70. private void ReloadAfterFillSignature(object sender, string e)
  71. {
  72. AfterFillSignature?.Invoke(sender, e);
  73. }
  74. }
  75. }