App.xaml.cs 975 B

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