App.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using ComPDFKit.NativeMethod;
  2. using Compdfkit_Tools.Helper;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Configuration;
  6. using System.Data;
  7. using System.Globalization;
  8. using System.Linq;
  9. using System.Threading;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. namespace DigitalSignature
  13. {
  14. /// <summary>
  15. /// Interaction logic for App.xaml
  16. /// </summary>
  17. public partial class App : Application
  18. {
  19. protected override void OnStartup(StartupEventArgs e)
  20. {
  21. base.OnStartup(e);
  22. LicenseVerify();
  23. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
  24. Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  25. }
  26. public static bool LicenseVerify()
  27. {
  28. if (!CPDFSDKVerifier.LoadNativeLibrary())
  29. return false;
  30. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(SDKLicenseHelper.ParseLicenseXML(), false);
  31. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  32. }
  33. }
  34. }