1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using compdfkit_tools.Form.Property;
- using ComPDFKitViewer.AnnotEvent;
- using ComPDFKitViewer.PdfViewer;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace compdfkit_tools.Form
- {
- /// <summary>
- /// FromPropertyControl.xaml 的交互逻辑
- /// </summary>
- public partial class FromPropertyControl : UserControl
- {
- private CPDFViewer pdfViewer;
- private UIElement currentPanel = null;
- public FromPropertyControl()
- {
- InitializeComponent();
- }
- public void CleanProperty()
- {
- }
- public void SetPropertyForType(WidgetArgs Args, AnnotAttribEvent e)
- {
- currentPanel = null;
- if (Args==null||e==null)
- {
- SetAnnotationPanel(currentPanel);
- return;
- }
- switch (Args.WidgeType)
- {
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_PUSHBUTTON:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_CHECKBOX:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_RADIOBUTTON:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_TEXTFIELD:
- TextFieldProperty textFieldProperty = new TextFieldProperty();
- textFieldProperty.SetProperty(Args,e);
- currentPanel = textFieldProperty;
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_COMBOBOX:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_LISTBOX:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS:
- break;
- case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_UNKNOWN:
- break;
- default:
- break;
- }
- SetAnnotationPanel(currentPanel);
- }
- private void SetAnnotationPanel(UIElement newChild)
- {
- FromPropertyPanel.Child = newChild;
- }
- public void SetPDFViewer(CPDFViewer pdfViewer)
- {
- this.pdfViewer = pdfViewer;
- }
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- }
- private void UserControl_Unloaded(object sender, RoutedEventArgs e)
- {
- }
- }
- }
|