|
@@ -1,201 +1,204 @@
|
|
-using System;
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
-using System.Configuration;
|
|
|
|
-using System.Data;
|
|
|
|
-using System.IO;
|
|
|
|
-using System.Linq;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
-using System.Windows;
|
|
|
|
-using System.Windows.Controls;
|
|
|
|
-using ComPDFKit.NativeMethod;
|
|
|
|
-using ComPDFKit_Conversion.Converter;
|
|
|
|
-using PDF_Office.CustomControl;
|
|
|
|
-using PDF_Office.CustomControl.SystemControl;
|
|
|
|
-using PDF_Office.ViewModels;
|
|
|
|
-using PDF_Office.Views;
|
|
|
|
-using PDF_Office.Views.BOTA;
|
|
|
|
-using PDF_Office.Views.Dialog;
|
|
|
|
-using PDF_Office.Views.HomePanel;
|
|
|
|
-using Prism.DryIoc;
|
|
|
|
-using Prism.Ioc;
|
|
|
|
-using Prism.Regions;
|
|
|
|
-using PDF_Office.Model;
|
|
|
|
-using PDF_Office.Views.PageEdit;
|
|
|
|
-using PDF_Office.Properties;
|
|
|
|
-using PDFSettings.Settings;
|
|
|
|
-using PDF_Office.Views.Tools;
|
|
|
|
-using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
|
|
|
|
-using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
|
|
|
|
-using PDF_Office.Views.Dialog.PageEditDialogs;
|
|
|
|
|
|
+using System;
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
+using System.Configuration;
|
|
|
|
+using System.Data;
|
|
|
|
+using System.IO;
|
|
|
|
+using System.Linq;
|
|
|
|
+using System.Threading.Tasks;
|
|
|
|
+using System.Windows;
|
|
|
|
+using System.Windows.Controls;
|
|
|
|
+using ComPDFKit.NativeMethod;
|
|
|
|
+using ComPDFKit_Conversion.Converter;
|
|
|
|
+using PDF_Office.CustomControl;
|
|
|
|
+using PDF_Office.CustomControl.SystemControl;
|
|
|
|
+using PDF_Office.ViewModels;
|
|
|
|
+using PDF_Office.Views;
|
|
|
|
+using PDF_Office.Views.BOTA;
|
|
|
|
+using PDF_Office.Views.Dialog;
|
|
|
|
+using PDF_Office.Views.HomePanel;
|
|
|
|
+using Prism.DryIoc;
|
|
|
|
+using Prism.Ioc;
|
|
|
|
+using Prism.Regions;
|
|
|
|
+using PDF_Office.Model;
|
|
|
|
+using PDF_Office.Views.PageEdit;
|
|
|
|
+using PDF_Office.Properties;
|
|
|
|
+using PDFSettings.Settings;
|
|
|
|
+using PDF_Office.Views.Tools;
|
|
|
|
+using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
|
|
|
|
+using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
|
|
|
|
+using PDF_Office.Views.Dialog.PageEditDialogs;
|
|
using PDF_Office.Views.Dialog.HomePageToolsDialogs ;
|
|
using PDF_Office.Views.Dialog.HomePageToolsDialogs ;
|
|
using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
|
|
using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
|
|
|
|
|
|
|
|
|
|
-namespace PDF_Office
|
|
|
|
-{
|
|
|
|
- /// <summary>
|
|
|
|
- /// App.xaml 的交互逻辑
|
|
|
|
- /// </summary>
|
|
|
|
- public partial class App : PrismApplication
|
|
|
|
- {
|
|
|
|
- public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
|
|
|
|
-
|
|
|
|
- public static MainWindowViewModel mainWindowViewModel;
|
|
|
|
-
|
|
|
|
- public static List<string> OpenedFileList = new List<string>();
|
|
|
|
-
|
|
|
|
- public static bool IsFirstOpen = true;
|
|
|
|
-
|
|
|
|
- public App()
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
-#if !DEBUG
|
|
|
|
- //接入Appcenter后台数据检测
|
|
|
|
- string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
|
|
|
|
- AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
|
|
|
|
- var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
|
|
|
|
- AppCenter.SetCountryCode(countryCode);
|
|
|
|
-#endif
|
|
|
|
- LicenseVerify();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (Settings.Default.RecentOpenFiles == null)
|
|
|
|
- Settings.Default.RecentOpenFiles = new RecentOpenFiles();
|
|
|
|
-
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- DirectoryInfo info = new DirectoryInfo(CurrentPath);
|
|
|
|
- if (File.Exists(CurrentPath))
|
|
|
|
- File.Delete(CurrentPath);
|
|
|
|
- if (!info.Exists)
|
|
|
|
- {
|
|
|
|
- info.Create();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch (Exception ex)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// 创建启动窗口
|
|
|
|
- /// </summary>
|
|
|
|
- /// <returns></returns>
|
|
|
|
- protected override Window CreateShell()
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- return Container.Resolve<MainWindow>();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
|
|
|
- {
|
|
|
|
- //注册内容组件
|
|
|
|
- containerRegistry.RegisterForNavigation<HomeContent>();
|
|
|
|
- containerRegistry.RegisterForNavigation<ViewContent>();
|
|
|
|
- containerRegistry.RegisterForNavigation<MainContent>();
|
|
|
|
- containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
|
|
|
|
- containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
|
|
|
|
- containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
|
|
|
|
- containerRegistry.RegisterForNavigation<BOTAContent>();
|
|
|
|
- containerRegistry.RegisterForNavigation<PageEditContent>();
|
|
|
|
- containerRegistry.RegisterForNavigation<ToolsBarContent>();
|
|
|
|
|
|
+namespace PDF_Office
|
|
|
|
+{
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// App.xaml 的交互逻辑
|
|
|
|
+ /// </summary>
|
|
|
|
+ public partial class App : PrismApplication
|
|
|
|
+ {
|
|
|
|
+ public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
|
|
|
|
+
|
|
|
|
+ public static MainWindowViewModel mainWindowViewModel;
|
|
|
|
+
|
|
|
|
+ public static List<string> OpenedFileList = new List<string>();
|
|
|
|
+
|
|
|
|
+ public static bool IsFirstOpen = true;
|
|
|
|
+
|
|
|
|
+ public App()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+#if !DEBUG
|
|
|
|
+ //接入Appcenter后台数据检测
|
|
|
|
+ string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
|
|
|
|
+ AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
|
|
|
|
+ var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
|
|
|
|
+ AppCenter.SetCountryCode(countryCode);
|
|
|
|
+#endif
|
|
|
|
+ LicenseVerify();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (Settings.Default.RecentOpenFiles == null)
|
|
|
|
+ Settings.Default.RecentOpenFiles = new RecentOpenFiles();
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ DirectoryInfo info = new DirectoryInfo(CurrentPath);
|
|
|
|
+ if (File.Exists(CurrentPath))
|
|
|
|
+ File.Delete(CurrentPath);
|
|
|
|
+ if (!info.Exists)
|
|
|
|
+ {
|
|
|
|
+ info.Create();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 创建启动窗口
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ protected override Window CreateShell()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ return Container.Resolve<MainWindow>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
|
|
|
+ {
|
|
|
|
+ //注册内容组件
|
|
|
|
+ containerRegistry.RegisterForNavigation<HomeContent>();
|
|
|
|
+ containerRegistry.RegisterForNavigation<ViewContent>();
|
|
|
|
+ containerRegistry.RegisterForNavigation<MainContent>();
|
|
|
|
+ containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
|
|
|
|
+ containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
|
|
|
|
+ containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
|
|
|
|
+ containerRegistry.RegisterForNavigation<BOTAContent>();
|
|
|
|
+ containerRegistry.RegisterForNavigation<PageEditContent>();
|
|
|
|
+ containerRegistry.RegisterForNavigation<ToolsBarContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
|
|
containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
|
|
- //注册弹窗
|
|
|
|
- containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
|
|
|
|
- containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
|
|
|
|
- containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
|
|
|
|
- containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
|
|
|
|
- containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
|
|
|
|
- containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
|
|
|
|
- containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
|
|
|
|
- containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
|
|
|
|
- containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
|
|
|
|
- containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
|
|
|
|
|
|
+
|
|
|
|
+ //注册弹窗
|
|
|
|
+ containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
|
|
|
|
+ containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
|
|
containerRegistry.RegisterDialog<HomePageExtractDialog>(DialogNames.HomePageExtractDialog);
|
|
containerRegistry.RegisterDialog<HomePageExtractDialog>(DialogNames.HomePageExtractDialog);
|
|
containerRegistry.RegisterDialog<HomePageInsertDialog>(DialogNames.HomePageInsertDialog);
|
|
containerRegistry.RegisterDialog<HomePageInsertDialog>(DialogNames.HomePageInsertDialog);
|
|
containerRegistry.RegisterDialog<HomePageSplitDialog>(DialogNames.HomePageSplitDialog);
|
|
containerRegistry.RegisterDialog<HomePageSplitDialog>(DialogNames.HomePageSplitDialog);
|
|
containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
|
|
containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
|
|
containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
|
|
containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
|
|
|
|
- {
|
|
|
|
- var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
|
|
|
|
-
|
|
|
|
- region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
|
|
|
|
-
|
|
|
|
- Container.Resolve<IRegionManager>().Regions.Add(region);
|
|
|
|
-
|
|
|
|
- base.ConfigureRegionAdapterMappings(regionAdapterMappings);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private static bool LicenseVerify()
|
|
|
|
- {
|
|
|
|
- bool result = false;
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- result = CPDFSDKVerifier.LoadNativeLibrary();
|
|
|
|
- if (!result)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- catch{ }
|
|
|
|
- string devKey = "";
|
|
|
|
- string devSecret = "";
|
|
|
|
-#if DEBUG
|
|
|
|
- devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34=";
|
|
|
|
- devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg==";
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
- string userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs=";
|
|
|
|
- string userSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/";
|
|
|
|
-
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret, userKey, userSecret);
|
|
|
|
- if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- catch{ }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- string ConverterDevKey = "mDDCTNY5rV2+FUj2JESUBruJ0643Tv7rNuxACu6g3L/0guIw1r8zZB+o3aw3rs4rrOThmxBXpEDcItvyGx096mF/3Ixg7aD6QZk5HvBEScIPerdM3KnhgwMwCjE0DYOSMCRwAhbA2xjXfXgT5VVo7JZroKOGQB5Qmf2kLl5nQuU=";
|
|
|
|
- string ConverterDevSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4g3S5AixMY+3TX1FpQaugG9sTsnCq4QxIEDzyAI3s3dWjNe3wDsMrmFq51HtjPa2tSFAoV6NtcUJC8skonXVk7kMv7C2jvq4o0q6sQtN3jR42k0n/LkN5UfbQ5Lfel4OfZrk7dh2/DUR87Ps4vBX1hrYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90=";
|
|
|
|
- string ConverterUserkey = "WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A=";
|
|
|
|
- string ConverterUserSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==";
|
|
|
|
-
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
|
|
|
|
- string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
|
|
- if (licenseerror != LicenseError.ERR_SUCCESS)
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- CPDFConverter.Init(resPath);*/
|
|
|
|
- string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
|
|
- LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
|
|
|
|
- if (licenseerror != LicenseError.ERR_SUCCESS)
|
|
|
|
- {
|
|
|
|
- //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- CPDFConverter.Init(resPath);
|
|
|
|
- }
|
|
|
|
- catch{ }
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected override void OnExit(ExitEventArgs e)
|
|
|
|
- {
|
|
|
|
- Environment.Exit(1);
|
|
|
|
- base.OnExit(e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
|
|
|
|
+ {
|
|
|
|
+ var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
|
|
|
|
+
|
|
|
|
+ region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
|
|
|
|
+
|
|
|
|
+ Container.Resolve<IRegionManager>().Regions.Add(region);
|
|
|
|
+
|
|
|
|
+ base.ConfigureRegionAdapterMappings(regionAdapterMappings);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static bool LicenseVerify()
|
|
|
|
+ {
|
|
|
|
+ bool result = false;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ result = CPDFSDKVerifier.LoadNativeLibrary();
|
|
|
|
+ if (!result)
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ catch{ }
|
|
|
|
+ string devKey = "";
|
|
|
|
+ string devSecret = "";
|
|
|
|
+#if DEBUG
|
|
|
|
+ devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34=";
|
|
|
|
+ devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg==";
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ string userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs=";
|
|
|
|
+ string userSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/";
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret, userKey, userSecret);
|
|
|
|
+ if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ catch{ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ string ConverterDevKey = "mDDCTNY5rV2+FUj2JESUBruJ0643Tv7rNuxACu6g3L/0guIw1r8zZB+o3aw3rs4rrOThmxBXpEDcItvyGx096mF/3Ixg7aD6QZk5HvBEScIPerdM3KnhgwMwCjE0DYOSMCRwAhbA2xjXfXgT5VVo7JZroKOGQB5Qmf2kLl5nQuU=";
|
|
|
|
+ string ConverterDevSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4g3S5AixMY+3TX1FpQaugG9sTsnCq4QxIEDzyAI3s3dWjNe3wDsMrmFq51HtjPa2tSFAoV6NtcUJC8skonXVk7kMv7C2jvq4o0q6sQtN3jR42k0n/LkN5UfbQ5Lfel4OfZrk7dh2/DUR87Ps4vBX1hrYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90=";
|
|
|
|
+ string ConverterUserkey = "WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A=";
|
|
|
|
+ string ConverterUserSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==";
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
|
|
|
|
+ string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
|
|
+ if (licenseerror != LicenseError.ERR_SUCCESS)
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ CPDFConverter.Init(resPath);*/
|
|
|
|
+ string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
|
|
+ LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
|
|
|
|
+ if (licenseerror != LicenseError.ERR_SUCCESS)
|
|
|
|
+ {
|
|
|
|
+ //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ CPDFConverter.Init(resPath);
|
|
|
|
+ }
|
|
|
|
+ catch{ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected override void OnExit(ExitEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ Environment.Exit(1);
|
|
|
|
+ base.OnExit(e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|