|
@@ -28,6 +28,7 @@ using MenuItem = System.Windows.Controls.MenuItem;
|
|
|
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
|
|
using UserControl = System.Windows.Controls.UserControl;
|
|
|
using System.Linq;
|
|
|
+using ComPDFKit.Tool.UndoManger;
|
|
|
|
|
|
namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
@@ -258,8 +259,17 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
{
|
|
|
if(e.Key == Key.S)
|
|
|
{
|
|
|
- textArea.AddStrikethrough();
|
|
|
- UpdateEditArea(oldRect, textArea);
|
|
|
+ bool result = textArea.AddStrikethrough();
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ PDFEditHistory editHistory = new PDFEditHistory();
|
|
|
+ CPDFPage page = PdfViewControl.PDFViewTool.GetCPDFViewer().GetDocument().PageAtIndex(pageIndex);
|
|
|
+ editHistory.EditPage = page.GetEditPage();
|
|
|
+ editHistory.PageIndex = pageIndex;
|
|
|
+ PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.AddHistory(editHistory);
|
|
|
+ UpdateEditArea(oldRect, textArea);
|
|
|
+ }
|
|
|
+
|
|
|
e.Handled = true;
|
|
|
}
|
|
|
}
|
|
@@ -296,8 +306,17 @@ namespace ComPDFKit.Controls.PDFControl
|
|
|
|
|
|
if (e.Key == Key.U)
|
|
|
{
|
|
|
- textArea.AddUnderline();
|
|
|
- UpdateEditArea(oldRect, textArea);
|
|
|
+ bool result = textArea.AddUnderline();
|
|
|
+ if(result)
|
|
|
+ {
|
|
|
+ PDFEditHistory editHistory = new PDFEditHistory();
|
|
|
+ CPDFPage page = PdfViewControl.PDFViewTool.GetCPDFViewer().GetDocument().PageAtIndex(pageIndex);
|
|
|
+ editHistory.EditPage = page.GetEditPage();
|
|
|
+ editHistory.PageIndex = pageIndex;
|
|
|
+ PdfViewControl.PDFViewTool.GetCPDFViewer().UndoManager.AddHistory(editHistory);
|
|
|
+ UpdateEditArea(oldRect, textArea);
|
|
|
+ }
|
|
|
+
|
|
|
e.Handled = true;
|
|
|
}
|
|
|
}
|