App.xaml.cs 1.0 KB

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