|
@@ -21,10 +21,10 @@ namespace PDFViewer
|
|
|
/// <summary>
|
|
|
/// Interaction logic for App.xaml
|
|
|
/// </summary>
|
|
|
- public partial class App: Application
|
|
|
+ public partial class App : Application
|
|
|
{
|
|
|
public static string CurrentCulture = Settings.Default.Cultrue;
|
|
|
- public static List<string> SupportedCultureList= new List<string>()
|
|
|
+ public static List<string> SupportedCultureList = new List<string>()
|
|
|
{
|
|
|
"en-US", "zh-CN"
|
|
|
};
|
|
@@ -32,6 +32,15 @@ namespace PDFViewer
|
|
|
public static FilePathList OpenedFilePathList = new FilePathList();
|
|
|
public static ResourceManager MainResourceManager = new ResourceManager("PDFViewer.Strings.SettingDialog", Assembly.GetExecutingAssembly());
|
|
|
|
|
|
+ public static bool LicenseVerify()
|
|
|
+ {
|
|
|
+ if (!CPDFSDKVerifier.LoadNativeLibrary())
|
|
|
+ return false;
|
|
|
+
|
|
|
+ LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(SDKLicenseHelper.ParseLicenseXML(), false);
|
|
|
+ return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(CurrentCulture))
|
|
@@ -44,7 +53,7 @@ namespace PDFViewer
|
|
|
Settings.Default.Cultrue = CurrentCulture;
|
|
|
Settings.Default.Save();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Thread.CurrentThread.CurrentUICulture = new CultureInfo(CurrentCulture);
|
|
|
Thread.CurrentThread.CurrentCulture = new CultureInfo(CurrentCulture);
|
|
|
base.OnStartup(e);
|
|
@@ -52,17 +61,8 @@ namespace PDFViewer
|
|
|
HistoryFile(@"TestFile\ComPDFKit_Sample_File_Windows.pdf");
|
|
|
FileHistoryHelper<PDFFileInfo>.Instance.LoadHistory();
|
|
|
}
|
|
|
-
|
|
|
- private static bool LicenseVerify()
|
|
|
- {
|
|
|
- if (!CPDFSDKVerifier.LoadNativeLibrary())
|
|
|
- return false;
|
|
|
|
|
|
- LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
|
|
|
- CPDFSDKVerifier.PrintPermissions();
|
|
|
- return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
private void HistoryFile(string item)
|
|
|
{
|
|
|
PDFFileInfo fileInfo = new PDFFileInfo();
|
|
@@ -82,7 +82,7 @@ namespace PDFViewer
|
|
|
base.Add(item);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public class ResourceConverter : IValueConverter
|
|
|
{
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
@@ -93,7 +93,7 @@ namespace PDFViewer
|
|
|
}
|
|
|
return App.MainResourceManager.GetString(parameter.ToString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
{
|
|
|
throw new NotSupportedException();
|