PDFContentEditControl.xaml.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using ComPDFKit.Tool;
  2. using Compdfkit_Tools.PDFControl;
  3. using System.Windows.Controls;
  4. namespace Compdfkit_Tools.Edit
  5. {
  6. public partial class PDFContentEditControl : UserControl
  7. {
  8. private PDFImageEditControl PDFImageEditControl = new PDFImageEditControl();
  9. private PDFTextEditControl PDFTextEditControl = new PDFTextEditControl();
  10. public PDFViewControl ViewControl { get; private set; }
  11. public PDFEditParam EditEvent { get; set; }
  12. public PDFContentEditControl()
  13. {
  14. InitializeComponent();
  15. }
  16. public void InitWithPDFViewer(PDFViewControl newPDFView)
  17. {
  18. ViewControl = newPDFView;
  19. PDFImageEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
  20. PDFTextEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
  21. }
  22. public void SetPDFTextEditData(TextEditParam editEvent, bool isTemp = false)
  23. {
  24. if (!isTemp)
  25. {
  26. PDFTextEditControl.SetPDFTextEditData(editEvent);
  27. ContentEditContainer.Child = PDFTextEditControl;
  28. }
  29. else
  30. {
  31. PDFTextEditControl tempPDFTextEditControl = new PDFTextEditControl();
  32. tempPDFTextEditControl.InitWithPDFViewer(ViewControl.PDFViewTool);
  33. tempPDFTextEditControl.SetPDFTextEditData(editEvent);
  34. ContentEditContainer.Child = tempPDFTextEditControl;
  35. }
  36. }
  37. //public void SetPDFTextMultiEditData(List<PDFEditEvent> editEventList)
  38. //{
  39. // PDFTextEditControl.SetPDFTextMultiEditData(editEventList);
  40. // ContentEditContainer.Child = PDFTextEditControl;
  41. //}
  42. public void ClearContentControl()
  43. {
  44. ContentEditContainer.Child = null;
  45. }
  46. public void SetPDFImageEditData(ImageEditParam editEvent)
  47. {
  48. PDFImageEditControl.SetPDFImageEditData(editEvent);
  49. ContentEditContainer.Child = PDFImageEditControl;
  50. }
  51. //public void SetPDFImageMultiEditData(List<PDFEditEvent> editEventList)
  52. //{
  53. // PDFImageEditControl.SetPDFImageMultiEditData(editEventList);
  54. // ContentEditContainer.Child = PDFImageEditControl;
  55. //}
  56. public void RefreshThumb()
  57. {
  58. PDFImageEditControl?.SetImageThumb();
  59. }
  60. }
  61. }