Quellcode durchsuchen

ComPDFKit.Demo - 修复数字签名列表右键菜单点击无效的问题

TangJinZhou vor 2 Monaten
Ursprung
Commit
579cd45ce9

+ 4 - 0
Demo/Examples/DigitalSignature/DigitalSignature.csproj

@@ -165,6 +165,10 @@
       <Link>x64\ComPDFKit.dll</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <None Include="..\license_key_windows.xml">
+      <Link>license_key_windows.xml</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
     <Content Include="..\TestFile\ComPDFKit_Signatures_Sample_File.pdf">
       <Link>ComPDFKit_Signatures_Sample_File.pdf</Link>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

+ 13 - 1
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -181,9 +181,15 @@ namespace PDFViewer
                 CPDFSaclingControl.SetZoomTextBoxText(string.Format("{0}", (int)(pdfviewer.GetZoom() * 100)));
 
                 botaBarControl.AddBOTAContent(new[] { BOTATools.Thumbnail, BOTATools.Outline, BOTATools.Bookmark, BOTATools.Annotation, BOTATools.Search });
+                botaBarControl.ViewCertificateEvent -= digitalSignatureControl.ViewCertificateEvent;
+                botaBarControl.ViewCertificateEvent += digitalSignatureControl.ViewCertificateEvent;
+                botaBarControl.ViewSignatureEvent -= digitalSignatureControl.ViewSignatureEvent;
+                botaBarControl.ViewSignatureEvent += digitalSignatureControl.ViewSignatureEvent;
+                botaBarControl.DeleteSignatureEvent -= BotaBarControl_DeleteSignatureEvent;
+                botaBarControl.DeleteSignatureEvent += BotaBarControl_DeleteSignatureEvent;
                 botaBarControl.SelectBotaTool(BOTATools.Thumbnail);
                 ViewSettingBtn.IsChecked = false;
-                botaBarControl.InitWithPDFViewer(viewControl);
+                botaBarControl.InitWithPDFViewer(viewControl); 
                 botaBarControl.SelectBotaTool(BOTATools.Thumbnail);
                 displaySettingsControl.InitWithPDFViewer(viewControl);
                 LoadCustomControl();
@@ -202,6 +208,12 @@ namespace PDFViewer
             }
         }
 
+        private void BotaBarControl_DeleteSignatureEvent(object sender, EventArgs e)
+        {
+            viewControl.PDFViewTool.IsDocumentModified = true;
+            DigitalSignatureControl_OnSignatureStatusChanged(sender, e);
+        }
+
         private void PDFToolManager_MouseLeftButtonDownHandler(object sender, MouseEventObject e)
         {
             if (e.annotType == C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET)