FillDigitalSignatureDialog.xaml.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. using Compdfkit_Tools.Helper;
  17. namespace Compdfkit_Tools.PDFControl
  18. {
  19. /// <summary>
  20. /// Interaction logic for FillDigitalSignatureDialog.xaml
  21. /// </summary>
  22. public partial class FillDigitalSignatureDialog : Window
  23. {
  24. private string _filePath = string.Empty;
  25. public string FilePath
  26. {
  27. get => _filePath;
  28. set
  29. {
  30. _filePath = value;
  31. FillDigitalSignatureControl.SignaturePath = value;
  32. }
  33. }
  34. private string _password = string.Empty;
  35. public string Password
  36. {
  37. get => _password;
  38. set
  39. {
  40. _password = value;
  41. FillDigitalSignatureControl.Password = value;
  42. }
  43. }
  44. private CPDFSignatureWidget _signatureWidget;
  45. public CPDFSignatureWidget SignatureWidget
  46. {
  47. get => this._signatureWidget;
  48. set
  49. {
  50. this._signatureWidget = value;
  51. FillDigitalSignatureControl.signatureWidget = value;
  52. }
  53. }
  54. private CPDFDocument _document;
  55. public CPDFDocument Document
  56. {
  57. get => _document;
  58. set
  59. {
  60. _document = value;
  61. FillDigitalSignatureControl.Document = value;
  62. }
  63. }
  64. public event EventHandler<string> AfterFillSignature;
  65. public FillDigitalSignatureDialog()
  66. {
  67. InitializeComponent();
  68. FillDigitalSignatureControl.AfterFillSignature -= ReloadAfterFillSignature;
  69. FillDigitalSignatureControl.AfterFillSignature += ReloadAfterFillSignature;
  70. Title = LanguageHelper.SigManager.GetString("Title_SignAp");
  71. }
  72. private void ReloadAfterFillSignature(object sender, string e)
  73. {
  74. AfterFillSignature?.Invoke(sender, e);
  75. }
  76. }
  77. }