|
@@ -83,7 +83,6 @@ namespace PDF_Master
|
|
/// </summary>
|
|
/// </summary>
|
|
public partial class App : PrismApplication
|
|
public partial class App : PrismApplication
|
|
{
|
|
{
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 产品名称
|
|
/// 产品名称
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -142,7 +141,7 @@ namespace PDF_Master
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 激活窗体的原因
|
|
/// 激活窗体的原因
|
|
/// </summary>
|
|
/// </summary>
|
|
- public static string WebOpencase = "";
|
|
|
|
|
|
+ public static string WebOpencase = "";
|
|
|
|
|
|
public static bool IsBookMode = false;
|
|
public static bool IsBookMode = false;
|
|
|
|
|
|
@@ -159,7 +158,6 @@ namespace PDF_Master
|
|
/// </summary>
|
|
/// </summary>
|
|
public static bool IsLogin = false;
|
|
public static bool IsLogin = false;
|
|
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 记录开始拖拽的窗口句柄,用于判断是否为跨窗口拖拽
|
|
/// 记录开始拖拽的窗口句柄,用于判断是否为跨窗口拖拽
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -169,6 +167,7 @@ namespace PDF_Master
|
|
/// 双击打开文件通知ID
|
|
/// 双击打开文件通知ID
|
|
/// </summary>
|
|
/// </summary>
|
|
public static uint MsgId;
|
|
public static uint MsgId;
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 将应用前置通知ID
|
|
/// 将应用前置通知ID
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -283,14 +282,14 @@ namespace PDF_Master
|
|
if (Settings.Default.PresetFontList == null)
|
|
if (Settings.Default.PresetFontList == null)
|
|
Settings.Default.PresetFontList = new PDFSettings.PresetFontList();
|
|
Settings.Default.PresetFontList = new PDFSettings.PresetFontList();
|
|
}
|
|
}
|
|
- catch {
|
|
|
|
-
|
|
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
{
|
|
- MsgId = Win32Helper.RegisterWindowMessage("msgNotify_PDFMaster");
|
|
|
|
|
|
+ MsgId = Win32Helper.RegisterWindowMessage("msgNotify_PDFMaster");
|
|
WakeId = Win32Helper.RegisterWindowMessage("msgWake_PDFMaster");
|
|
WakeId = Win32Helper.RegisterWindowMessage("msgWake_PDFMaster");
|
|
WakeId = Win32Helper.RegisterWindowMessage("webopenexpired_PDFMaster");
|
|
WakeId = Win32Helper.RegisterWindowMessage("webopenexpired_PDFMaster");
|
|
Process[] pros = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
|
|
Process[] pros = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
|
|
@@ -299,11 +298,11 @@ namespace PDF_Master
|
|
{
|
|
{
|
|
if (e != null && e.Args != null && e.Args.Length > 0)
|
|
if (e != null && e.Args != null && e.Args.Length > 0)
|
|
{
|
|
{
|
|
- if (Webgoapp(e.Args)==true)
|
|
|
|
|
|
+ if (Webgoapp(e.Args) == true)
|
|
{
|
|
{
|
|
- if(WebOpencase=="expired")
|
|
|
|
|
|
+ if (WebOpencase == "expired")
|
|
{
|
|
{
|
|
- Win32Helper.PostMessage((IntPtr)0xffff,WebopenexpiredId, IntPtr.Zero, IntPtr.Zero);
|
|
|
|
|
|
+ Win32Helper.PostMessage((IntPtr)0xffff, WebopenexpiredId, IntPtr.Zero, IntPtr.Zero);
|
|
IntPtr waitPtr = Win32Helper.CreateEvent(IntPtr.Zero, true, false, "Global\\shareWaitNotify" + Guid.NewGuid());
|
|
IntPtr waitPtr = Win32Helper.CreateEvent(IntPtr.Zero, true, false, "Global\\shareWaitNotify" + Guid.NewGuid());
|
|
Win32Helper.WaitForSingleObject(waitPtr, 5000);
|
|
Win32Helper.WaitForSingleObject(waitPtr, 5000);
|
|
Win32Helper.CloseHandle(waitPtr);
|
|
Win32Helper.CloseHandle(waitPtr);
|
|
@@ -315,8 +314,6 @@ namespace PDF_Master
|
|
Win32Helper.WaitForSingleObject(waitPtr, 5000);
|
|
Win32Helper.WaitForSingleObject(waitPtr, 5000);
|
|
Win32Helper.CloseHandle(waitPtr);
|
|
Win32Helper.CloseHandle(waitPtr);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -354,12 +351,10 @@ namespace PDF_Master
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
{
|
|
{
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -373,8 +368,6 @@ namespace PDF_Master
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
if (!LicenseVerify())
|
|
if (!LicenseVerify())
|
|
{
|
|
{
|
|
#if !DEBUG
|
|
#if !DEBUG
|
|
@@ -392,7 +385,7 @@ namespace PDF_Master
|
|
InitSettings();
|
|
InitSettings();
|
|
|
|
|
|
#if DEBUG
|
|
#if DEBUG
|
|
- IsLogin =false;
|
|
|
|
|
|
+ IsLogin = false;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
CachePath = CacheFilePath.Instance;
|
|
CachePath = CacheFilePath.Instance;
|
|
@@ -432,13 +425,13 @@ namespace PDF_Master
|
|
{
|
|
{
|
|
GuidPDFPath = Path.Combine(CachePath.GuidPDFPath, "Quick Start Guide.pdf");
|
|
GuidPDFPath = Path.Combine(CachePath.GuidPDFPath, "Quick Start Guide.pdf");
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
#region 设置软件语系
|
|
#region 设置软件语系
|
|
|
|
+
|
|
List<string> lang = new List<string>() { "zh-CN", "zh-TW", "en-US" };
|
|
List<string> lang = new List<string>() { "zh-CN", "zh-TW", "en-US" };
|
|
CultureInfo cultureInfo = new CultureInfo("en-US");
|
|
CultureInfo cultureInfo = new CultureInfo("en-US");
|
|
//if (lang.Contains(Settings.Default.AppProperties.culture))
|
|
//if (lang.Contains(Settings.Default.AppProperties.culture))
|
|
@@ -454,7 +447,7 @@ namespace PDF_Master
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion 设置软件语系
|
|
|
|
|
|
//启动循环检查更新线程
|
|
//启动循环检查更新线程
|
|
CheckUpdate();
|
|
CheckUpdate();
|
|
@@ -473,6 +466,7 @@ namespace PDF_Master
|
|
|
|
|
|
base.OnStartup(e);
|
|
base.OnStartup(e);
|
|
}
|
|
}
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 解析是否带参数启动
|
|
/// 解析是否带参数启动
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -545,6 +539,7 @@ namespace PDF_Master
|
|
Crashes.TrackError(e.Exception);
|
|
Crashes.TrackError(e.Exception);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 创建启动窗口
|
|
/// 创建启动窗口
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -758,7 +753,6 @@ namespace PDF_Master
|
|
containerRegistry.RegisterDialog<SubscriptionOKDialog>(DialogNames.SubscriptionOKDialog);
|
|
containerRegistry.RegisterDialog<SubscriptionOKDialog>(DialogNames.SubscriptionOKDialog);
|
|
containerRegistry.RegisterDialog<LoginoffDialog>(DialogNames.LoginoffDialog);
|
|
containerRegistry.RegisterDialog<LoginoffDialog>(DialogNames.LoginoffDialog);
|
|
|
|
|
|
-
|
|
|
|
//新手引导弹窗
|
|
//新手引导弹窗
|
|
containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
|
|
containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
|
|
containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
|
|
containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
|
|
@@ -773,7 +767,8 @@ namespace PDF_Master
|
|
|
|
|
|
//OCR下载弹窗
|
|
//OCR下载弹窗
|
|
containerRegistry.RegisterDialog<OCRDownloadProgress>(DialogNames.OCRDownloadProgress);
|
|
containerRegistry.RegisterDialog<OCRDownloadProgress>(DialogNames.OCRDownloadProgress);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ containerRegistry.RegisterDialog<ChangeEmailDialog>(DialogNames.ChangeEmailDialog);
|
|
|
|
|
|
#endregion 注册弹窗
|
|
#endregion 注册弹窗
|
|
}
|
|
}
|
|
@@ -826,7 +821,6 @@ namespace PDF_Master
|
|
Trace.WriteLine("CPDFSDK License Code." + verifyResult + "\n");
|
|
Trace.WriteLine("CPDFSDK License Code." + verifyResult + "\n");
|
|
if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
|
|
if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
|
|
return false;
|
|
return false;
|
|
-
|
|
|
|
}
|
|
}
|
|
catch { Trace.WriteLine("CPDFSDK License Code Error \n"); }
|
|
catch { Trace.WriteLine("CPDFSDK License Code Error \n"); }
|
|
|
|
|
|
@@ -848,10 +842,10 @@ namespace PDF_Master
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
CPDFConverter.Init(resPath);*/
|
|
CPDFConverter.Init(resPath);*/
|
|
-
|
|
|
|
|
|
+
|
|
string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
|
|
CPDFConverter.Init(resPath);
|
|
CPDFConverter.Init(resPath);
|
|
-
|
|
|
|
|
|
+
|
|
LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
|
|
LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
|
|
//初始化ocr库
|
|
//初始化ocr库
|
|
CPDFConverter.InitOCRLibrary(Path.Combine(resPath, "x64"));
|
|
CPDFConverter.InitOCRLibrary(Path.Combine(resPath, "x64"));
|
|
@@ -909,9 +903,11 @@ namespace PDF_Master
|
|
case "zh-CN":
|
|
case "zh-CN":
|
|
lang = "zh_Hans";
|
|
lang = "zh_Hans";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case "zh-TW":
|
|
case "zh-TW":
|
|
lang = "zh_Hant";
|
|
lang = "zh_Hant";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
lang = "en_Us";
|
|
lang = "en_Us";
|
|
break;
|
|
break;
|
|
@@ -953,7 +949,6 @@ namespace PDF_Master
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
{
|
|
{
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|