App.xaml.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Globalization;
  2. using ComPDFKit.NativeMethod;
  3. using Compdfkit_Tools.Helper;
  4. using System.Reflection;
  5. using System.Threading;
  6. using System.Windows;
  7. using System.Xml;
  8. using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
  9. namespace AnnotationViewControl
  10. {
  11. /// <summary>
  12. /// Interaction logic for App.xaml
  13. /// </summary>
  14. public partial class App: Application
  15. {
  16. protected override void OnStartup(StartupEventArgs e)
  17. {
  18. string str = this.GetType().Assembly.Location;
  19. base.OnStartup(e);
  20. LicenseVerify();
  21. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
  22. Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  23. }
  24. private static bool LicenseVerify()
  25. {
  26. if (!LoadNativeLibrary())
  27. return false;
  28. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
  29. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  30. }
  31. }
  32. }