PDFContentEditControl.xaml.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. public PDFViewControl ViewControl { get; private set; }
  13. public PDFEditParam EditEvent { get; set; }
  14. #endregion
  15. public PDFContentEditControl()
  16. {
  17. InitializeComponent();
  18. }
  19. public void InitWithPDFViewer(PDFViewControl newPDFView)
  20. {
  21. ViewControl = newPDFView;
  22. PDFImageEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
  23. PDFTextEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
  24. }
  25. public void SetRotationText(float rotation)
  26. {
  27. PDFImageEditControl.SetRotationText(rotation);
  28. }
  29. public void SetPDFTextEditData(List<TextEditParam> editEvent, bool isTemp = false)
  30. {
  31. if (!isTemp)
  32. {
  33. PDFTextEditControl.SetPDFTextEditData(editEvent);
  34. ContentEditContainer.Child = PDFTextEditControl;
  35. }
  36. else
  37. {
  38. PDFTextEditControl tempPDFTextEditControl = new PDFTextEditControl();
  39. tempPDFTextEditControl.InitWithPDFViewer(ViewControl.PDFViewTool);
  40. tempPDFTextEditControl.SetPDFTextEditData(editEvent);
  41. ContentEditContainer.Child = tempPDFTextEditControl;
  42. }
  43. }
  44. //public void SetPDFTextMultiEditData(List<PDFEditEvent> editEventList)
  45. //{
  46. // PDFTextEditControl.SetPDFTextMultiEditData(editEventList);
  47. // ContentEditContainer.Child = PDFTextEditControl;
  48. //}
  49. public void ClearContentControl()
  50. {
  51. ContentEditContainer.Child = null;
  52. }
  53. public void SetPDFImageEditData(List<ImageEditParam> editEvent)
  54. {
  55. PDFImageEditControl.SetPDFImageEditData(editEvent);
  56. ContentEditContainer.Child = PDFImageEditControl;
  57. }
  58. //public void SetPDFImageMultiEditData(List<PDFEditEvent> editEventList)
  59. //{
  60. // PDFImageEditControl.SetPDFImageMultiEditData(editEventList);
  61. // ContentEditContainer.Child = PDFImageEditControl;
  62. //}
  63. public void RefreshThumb()
  64. {
  65. PDFImageEditControl?.SetImageThumb();
  66. }
  67. }
  68. }