|
@@ -24,7 +24,6 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
private SignatureStatusBarControl signatureStatusBarControl;
|
|
|
private PanelState panelState = PanelState.GetInstance();
|
|
|
private CPDFDisplaySettingsControl displaySettingsControl = null;
|
|
|
- private CPDFBOTABarControl botaControl;
|
|
|
private bool _isActive = false;
|
|
|
public event EventHandler<bool> OnCanSaveChanged;
|
|
|
private CPDFSignatureWidget currentSignatureWidget;
|
|
@@ -123,26 +122,21 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void BotaControlOnDeleteSignatureEvent(object sender, EventArgs e)
|
|
|
+ public void BotaControlOnDeleteSignatureEvent(object sender, EventArgs e)
|
|
|
{
|
|
|
- RefreshDigitalSignatureList();
|
|
|
+ UpdateSignatureStatusBarControl();
|
|
|
}
|
|
|
|
|
|
private void PDFView_WidgetClickHandler(object sender, WidgetArgs e)
|
|
|
{
|
|
|
- Window parentWindow = Window.GetWindow((DependencyObject)sender);
|
|
|
var signatureWidget = (e as WidgetSignArgs).Sign;
|
|
|
if (signatureWidget.IsSigned())
|
|
|
{
|
|
|
- VerifyDigitalSignatureControl verifyDigitalSignatureControl = new VerifyDigitalSignatureControl
|
|
|
- {
|
|
|
- Owner = parentWindow
|
|
|
- };
|
|
|
- verifyDigitalSignatureControl.InitWithSignature(signatureWidget.GetSignature());
|
|
|
- verifyDigitalSignatureControl.ShowDialog();
|
|
|
+ ViewSignatureEvent(sender, signatureWidget.GetSignature());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ Window parentWindow = Window.GetWindow((DependencyObject)sender);
|
|
|
AddCertificationDialog addCertificationControl = new AddCertificationDialog
|
|
|
{
|
|
|
Owner = parentWindow
|
|
@@ -186,11 +180,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
ToggleButton button = sender as ToggleButton;
|
|
|
button.IsChecked = false;
|
|
|
- RefreshDigitalSignatureList();
|
|
|
+ UpdateSignatureStatusBarControl();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void RefreshDigitalSignatureList()
|
|
|
+ private void UpdateSignatureStatusBarControl()
|
|
|
{
|
|
|
signatureStatusBarControl.SetStatus(SignatureHelper.GetEffectiveSignatureList(PDFViewControl.PDFView.Document.GetSignatureList()));
|
|
|
}
|
|
@@ -267,10 +261,14 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
public void SetBOTAContainer(CPDFBOTABarControl botaControl)
|
|
|
{
|
|
|
- this.BotaContainer.Child = botaControl;
|
|
|
- this.botaControl = botaControl;
|
|
|
- this.botaControl.DeleteSignatureEvent -= BotaControlOnDeleteSignatureEvent;
|
|
|
- this.botaControl.DeleteSignatureEvent += BotaControlOnDeleteSignatureEvent;
|
|
|
+ BotaContainer.Child = botaControl;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void ViewCertificateEvent(object sender, CPDFSignature e)
|
|
|
+ {
|
|
|
+ ViewCertificateDialog dialog = new ViewCertificateDialog();
|
|
|
+ dialog.Show();
|
|
|
+ dialog.InitCertificateList(e);
|
|
|
}
|
|
|
|
|
|
public void SetDisplaySettingsControl(CPDFDisplaySettingsControl displaySettingsControl)
|
|
@@ -335,5 +333,18 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
PDFViewControl.PDFView.UndoManager?.Redo();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void ViewSignatureEvent(object sender, CPDFSignature e)
|
|
|
+ {
|
|
|
+ Window parentWindow = Window.GetWindow((DependencyObject)sender);
|
|
|
+ VerifyDigitalSignatureControl dialog = new VerifyDigitalSignatureControl()
|
|
|
+ {
|
|
|
+ Owner = parentWindow
|
|
|
+ };
|
|
|
+ dialog.ViewCertificateEvent -= ViewCertificateEvent;
|
|
|
+ dialog.ViewCertificateEvent += ViewCertificateEvent;
|
|
|
+ dialog.InitWithSignature(e);
|
|
|
+ dialog.ShowDialog();
|
|
|
+ }
|
|
|
}
|
|
|
}
|