App.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.Reflection;
  10. using System.Threading;
  11. using System.Threading.Tasks;
  12. using System.Windows;
  13. namespace DocsEditControl
  14. {
  15. /// <summary>
  16. /// Interaction logic for App.xaml
  17. /// </summary>
  18. public partial class App : Application
  19. {
  20. protected override void OnStartup(StartupEventArgs e)
  21. {
  22. string str = this.GetType().Assembly.Location;
  23. base.OnStartup(e);
  24. LicenseVerify();
  25. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
  26. Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  27. }
  28. public static bool LicenseVerify()
  29. {
  30. if (!CPDFSDKVerifier.LoadNativeLibrary())
  31. return false;
  32. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(SDKLicenseHelper.ParseLicenseXML(), false);
  33. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  34. }
  35. }
  36. }