App.xaml.cs 1.0 KB

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