|
@@ -1,14 +1,20 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.ComponentModel;
|
|
|
using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using System.Windows.Data;
|
|
|
+using System.Windows.Forms;
|
|
|
using System.Windows.Input;
|
|
|
using Compdfkit_Tools.PDFControl;
|
|
|
using ComPDFKit.DigitalSign;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
+using ContextMenu = System.Windows.Controls.ContextMenu;
|
|
|
+using MenuItem = System.Windows.Controls.MenuItem;
|
|
|
+using MessageBox = System.Windows.MessageBox;
|
|
|
+using UserControl = System.Windows.Controls.UserControl;
|
|
|
|
|
|
namespace Compdfkit_Tools.DigitalSignature.CPDFSignatureListControl
|
|
|
{
|
|
@@ -24,6 +30,8 @@ namespace Compdfkit_Tools.DigitalSignature.CPDFSignatureListControl
|
|
|
private List<SignatureData> signatureDataList;
|
|
|
private List<CPDFSignature> signatureList;
|
|
|
private ContextMenu popContextMenu;
|
|
|
+
|
|
|
+ public event EventHandler DeleteSignatureEvent;
|
|
|
public CPDFSignatureListControl()
|
|
|
{
|
|
|
InitializeComponent();
|
|
@@ -60,11 +68,22 @@ namespace Compdfkit_Tools.DigitalSignature.CPDFSignatureListControl
|
|
|
|
|
|
private void DeleteMenu_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
+ // custom button content
|
|
|
+ string messageBoxText = "Are you sure you want to delete this signature?";
|
|
|
+ string caption = "Delete Signature";
|
|
|
+ MessageBoxButton button = MessageBoxButton.OKCancel;
|
|
|
+ MessageBoxImage icon = MessageBoxImage.Warning;
|
|
|
+ MessageBoxResult result = MessageBox.Show(messageBoxText, caption, button, icon, MessageBoxResult.Cancel);
|
|
|
+ if(result != MessageBoxResult.OK)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
int index = SignatureList.SelectedIndex;
|
|
|
if (index >= 0 && index < signatureList.Count)
|
|
|
{
|
|
|
pdfViewer.Document.RemoveSignature(signatureList[index], true);
|
|
|
LoadSignatureList();
|
|
|
+ DeleteSignatureEvent?.Invoke(this, null);
|
|
|
}
|
|
|
}
|
|
|
|