1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using ComPDFKit.PDFAnnotation;
- using ComPDFKit.PDFAnnotation.Form;
- using ComPDFKit.PDFDocument;
- using ComPDFKit.Tool;
- using ComPDFKit.Tool.Help;
- using System.Windows;
- using System.Windows.Controls;
- namespace Compdfkit_Tools.PDFControl
- {
- public partial class SignatureProperty : UserControl
- {
- private SignatureParam widgetParam = null;
- private CPDFSignatureWidget cPDFAnnotation = null;
- private PDFViewControl pdfViewerControl = null;
- private CPDFDocument cPDFDocument = null;
- bool IsLoadedData = false;
- public SignatureProperty()
- {
- InitializeComponent();
- }
- public void SetProperty(AnnotParam annotParam, CPDFAnnotation annotation, CPDFDocument doc, PDFViewControl cPDFViewer)
- {
- widgetParam = (SignatureParam)annotParam;
- cPDFAnnotation = (CPDFSignatureWidget)annotation;
- pdfViewerControl = cPDFViewer;
- cPDFDocument = doc;
- }
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- FormFieldCombox.SelectedIndex = (int)ParamConverter.ConverterWidgetFormFlags(widgetParam.Flags, widgetParam.IsHidden);
- IsLoadedData = true;
- }
- private void UserControl_Unloaded(object sender, RoutedEventArgs e)
- {
- IsLoadedData = false;
- }
- private void FormFieldCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (IsLoadedData)
- {
- cPDFAnnotation.SetFlags(ParamConverter.GetFormFlags((ParamConverter.FormField)(sender as ComboBox).SelectedIndex, cPDFAnnotation));
- pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDateAnnotFrame();
- }
- }
- }
- }
|