1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using ComPDFKit.Tool;
- using Compdfkit_Tools.PDFControl;
- using System.Windows.Controls;
- namespace Compdfkit_Tools.Edit
- {
- public partial class PDFContentEditControl : UserControl
- {
- private PDFImageEditControl PDFImageEditControl = new PDFImageEditControl();
- private PDFTextEditControl PDFTextEditControl = new PDFTextEditControl();
- public PDFViewControl ViewControl { get; private set; }
- public PDFEditParam EditEvent { get; set; }
- public PDFContentEditControl()
- {
- InitializeComponent();
- }
- public void InitWithPDFViewer(PDFViewControl newPDFView)
- {
- ViewControl = newPDFView;
- PDFImageEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
- PDFTextEditControl.InitWithPDFViewer(newPDFView.PDFViewTool);
- }
- public void SetPDFTextEditData(TextEditParam editEvent, bool isTemp = false)
- {
- if (!isTemp)
- {
- PDFTextEditControl.SetPDFTextEditData(editEvent);
- ContentEditContainer.Child = PDFTextEditControl;
- }
- else
- {
- PDFTextEditControl tempPDFTextEditControl = new PDFTextEditControl();
- tempPDFTextEditControl.InitWithPDFViewer(ViewControl.PDFViewTool);
- tempPDFTextEditControl.SetPDFTextEditData(editEvent);
- ContentEditContainer.Child = tempPDFTextEditControl;
- }
- }
- public void ClearContentControl()
- {
- ContentEditContainer.Child = null;
- }
- public void SetPDFImageEditData(ImageEditParam editEvent)
- {
- PDFImageEditControl.SetPDFImageEditData(editEvent);
- ContentEditContainer.Child = PDFImageEditControl;
- }
- public void RefreshThumb()
- {
- PDFImageEditControl?.SetImageThumb();
- }
- }
- }
|