FromPropertyControl.xaml.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using compdfkit_tools.Form.Property;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using ComPDFKitViewer.PdfViewer;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace compdfkit_tools.Form
  19. {
  20. /// <summary>
  21. /// FromPropertyControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class FromPropertyControl : UserControl
  24. {
  25. private CPDFViewer pdfViewer;
  26. private UIElement currentPanel = null;
  27. public FromPropertyControl()
  28. {
  29. InitializeComponent();
  30. }
  31. public void CleanProperty()
  32. {
  33. }
  34. public void SetPropertyForType(WidgetArgs Args, AnnotAttribEvent e)
  35. {
  36. currentPanel = null;
  37. if (Args==null||e==null)
  38. {
  39. SetAnnotationPanel(currentPanel);
  40. return;
  41. }
  42. switch (Args.WidgeType)
  43. {
  44. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_PUSHBUTTON:
  45. break;
  46. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_CHECKBOX:
  47. break;
  48. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_RADIOBUTTON:
  49. break;
  50. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_TEXTFIELD:
  51. TextFieldProperty textFieldProperty = new TextFieldProperty();
  52. textFieldProperty.SetProperty(Args,e);
  53. currentPanel = textFieldProperty;
  54. break;
  55. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_COMBOBOX:
  56. break;
  57. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_LISTBOX:
  58. break;
  59. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS:
  60. break;
  61. case ComPDFKit.PDFAnnotation.Form.C_WIDGET_TYPE.WIDGET_UNKNOWN:
  62. break;
  63. default:
  64. break;
  65. }
  66. SetAnnotationPanel(currentPanel);
  67. }
  68. private void SetAnnotationPanel(UIElement newChild)
  69. {
  70. FromPropertyPanel.Child = newChild;
  71. }
  72. public void SetPDFViewer(CPDFViewer pdfViewer)
  73. {
  74. this.pdfViewer = pdfViewer;
  75. }
  76. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  77. {
  78. }
  79. private void UserControl_Unloaded(object sender, RoutedEventArgs e)
  80. {
  81. }
  82. }
  83. }