Browse Source

compdfkit(win) - 调整在线验证为同步,修复文案切换失效bug

liuaoran 1 year ago
parent
commit
9bfffffba8

+ 2 - 1
Demo/Examples/Compdfkit_Tools/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -20,6 +20,7 @@ using Compdfkit_Tools.Helper;
 using ComPDFKit.DigitalSign;
 using ComPDFKit.PDFAnnotation.Form;
 using PasswordBoxPlus.Helper;
+using ComPDFKit.NativeMethod;
 
 namespace Compdfkit_Tools.PDFControl
 {
@@ -710,7 +711,7 @@ namespace Compdfkit_Tools.PDFControl
         }
 
         private void AnnotationBarControl_AnnotationPropertyChanged(object sender, CPDFAnnotationType e)
-        {
+        { 
             PDFAnnotationControl.LoadAnnotationPanel(e);
             if (e != CPDFAnnotationType.Audio && e != CPDFAnnotationType.Image)
             {

+ 10 - 6
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -45,12 +45,6 @@
     <ApplicationIcon>ComPDFKit_Logo.ico</ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="ComPDFKit.Desk, Version=1.12.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <HintPath>..\packages\ComPDFKit.NetFramework.1.12.0\lib\ComPDFKit.Desk.dll</HintPath>
-    </Reference>
-    <Reference Include="ComPDFKit.Viewer, Version=1.12.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <HintPath>..\packages\ComPDFKit.NetFramework.1.12.0\lib\ComPDFKit.Viewer.dll</HintPath>
-    </Reference>
     <Reference Include="Nager.Country, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <HintPath>..\packages\Nager.Country.4.0.0\lib\netstandard2.0\Nager.Country.dll</HintPath>
     </Reference>
@@ -1264,6 +1258,16 @@
   <ItemGroup>
     <Folder Include="DigitalSignature\CPDFSignatureListControl\" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\compdfkit\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
+      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
+      <Name>ComPDFKit.Desk</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\compdfkit\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
+      <Project>{18ec356d-8130-49d4-b4e6-ac290e1065b7}</Project>
+      <Name>ComPDFKit.Viewer</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\packages\ComPDFKit.NetFramework.1.12.0\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\packages\ComPDFKit.NetFramework.1.12.0\build\ComPDFKit.NetFramework.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

+ 8 - 6
Demo/Examples/PDFViewer/App.xaml.cs

@@ -29,18 +29,18 @@ namespace PDFViewer
         public static FilePathList OpenedFilePathList = new FilePathList();
         public static ResourceManager MainResourceManager = new ResourceManager("PDFViewer.Strings.SettingDialog", Assembly.GetExecutingAssembly());
 
-        public static async Task<bool> LicenseVerify()
+        public static bool LicenseVerify()
         {
             if (!CPDFSDKVerifier.LoadNativeLibrary())
             { 
                 return false; 
             }
-            LicenseErrorCode status = await CPDFSDKVerifier.OnlineLicenseVerify("mD+ps2sEont1y/VZsWhSBVyaWquC3WCUCqk8QkLFzkU=");
+            LicenseErrorCode status = CPDFSDKVerifier.OnlineLicenseVerify("mD+ps2sEont1y/VZsWhSBVyaWquC3WCUCqk8QkLFzkU=");
             return status == LicenseErrorCode.E_LICENSE_SUCCESS;
         }
 
-        protected override async void OnStartup(StartupEventArgs e)
-        {
+        protected override void OnStartup(StartupEventArgs e)
+        { 
             if (string.IsNullOrEmpty(CurrentCulture))
             {
                 CurrentCulture = CultureInfo.CurrentCulture.Name;
@@ -54,9 +54,11 @@ namespace PDFViewer
 
             Thread.CurrentThread.CurrentUICulture = new CultureInfo(CurrentCulture);
             Thread.CurrentThread.CurrentCulture = new CultureInfo(CurrentCulture);
-            base.OnStartup(e);
 
-            await LicenseVerify();
+            base.OnStartup(e);
+             
+            LicenseVerify();
+            
             CPDFSDKVerifier.LicenseRefreshed -= CPDFSDKVerifier_LicenseRefreshed;
             CPDFSDKVerifier.LicenseRefreshed += CPDFSDKVerifier_LicenseRefreshed;
             HistoryFile(@"TestFile\ComPDFKit_Sample_File_Windows.pdf");