PDFContentEditControl.xaml.cs 2.9 KB

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