|
@@ -16,6 +16,8 @@ using ComPDFKit.Tool;
|
|
|
using ComPDFKit.Tool.Help;
|
|
|
using System.Windows.Input;
|
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
|
+using ComPDFKit.Tool.UndoManger;
|
|
|
+using ComPDFKitViewer.Helper;
|
|
|
using static ComPDFKit.PDFAnnotation.CTextAttribute.CFontNameHelper;
|
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
|
|
|
|
|
@@ -149,8 +151,16 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
cPDFAnnotation.SetFieldName((sender as TextBox).Text);
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -159,8 +169,16 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
cPDFAnnotation.SetFlags(ParamConverter.GetFormFlags((ParamConverter.FormField)(sender as ComboBox).SelectedIndex, cPDFAnnotation));
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -169,12 +187,20 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
byte[] Color = new byte[3];
|
|
|
Color[0] = ((SolidColorBrush)BorderColorPickerControl.Brush).Color.R;
|
|
|
Color[1] = ((SolidColorBrush)BorderColorPickerControl.Brush).Color.G;
|
|
|
Color[2] = ((SolidColorBrush)BorderColorPickerControl.Brush).Color.B;
|
|
|
cPDFAnnotation.SetWidgetBorderRGBColor(Color);
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -183,12 +209,20 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
byte[] Color = new byte[3];
|
|
|
Color[0] = ((SolidColorBrush)BackgroundColorPickerControl.Brush).Color.R;
|
|
|
Color[1] = ((SolidColorBrush)BackgroundColorPickerControl.Brush).Color.G;
|
|
|
Color[2] = ((SolidColorBrush)BackgroundColorPickerControl.Brush).Color.B;
|
|
|
cPDFAnnotation.SetWidgetBgRGBColor(Color);
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -196,6 +230,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
byte[] Color = new byte[3];
|
|
|
Color[0] = ((SolidColorBrush)TextColorPickerControl.Brush).Color.R;
|
|
|
Color[1] = ((SolidColorBrush)TextColorPickerControl.Brush).Color.G;
|
|
@@ -205,6 +244,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
cPDFAnnotation.SetTextAttribute(cTextAttribute);
|
|
|
cPDFAnnotation.UpdateFormAp();
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -212,6 +254,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
|
|
|
bool isBold = IsBold(cTextAttribute.FontName);
|
|
|
bool isItalic = IsItalic(cTextAttribute.FontName);
|
|
@@ -220,6 +267,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
cPDFAnnotation.SetTextAttribute(cTextAttribute);
|
|
|
cPDFAnnotation.UpdateFormAp();
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -227,6 +277,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
|
|
|
bool isItalic = false;
|
|
|
bool isBold = false;
|
|
@@ -255,6 +310,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
cPDFAnnotation.SetTextAttribute(cTextAttribute);
|
|
|
cPDFAnnotation.UpdateFormAp();
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -262,11 +320,19 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
|
|
|
cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
|
|
|
cPDFAnnotation.SetTextAttribute(cTextAttribute);
|
|
|
cPDFAnnotation.UpdateFormAp();
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -275,6 +341,11 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
ActionContentText.Style = null;
|
|
|
switch (TextAlignmentCmb.SelectedIndex)
|
|
|
{
|
|
@@ -299,6 +370,9 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
if (ActionContentText.Visibility != Visibility.Collapsed && ActionContentText != null)
|
|
|
AddAction();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -350,8 +424,16 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
cPDFAnnotation.SetButtonTitle((sender as TextBox).Text);
|
|
|
pdfViewerControl.UpdateAnnotFrame();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -359,7 +441,15 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (IsLoadedData)
|
|
|
{
|
|
|
+ PushButtonHistory history = new PushButtonHistory();
|
|
|
+ history.Action = HistoryAction.Update;
|
|
|
+ history.PDFDoc = pdfViewerControl.GetCPDFViewer().GetDocument();
|
|
|
+ history.PreviousParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+
|
|
|
AddAction();
|
|
|
+
|
|
|
+ history.CurrentParam = ParamConverter.CPDFDataConverterToAnnotParam(history.PDFDoc, cPDFAnnotation.Page.PageIndex, cPDFAnnotation);
|
|
|
+ pdfViewerControl.GetCPDFViewer().UndoManager.AddHistory(history);
|
|
|
}
|
|
|
}
|
|
|
|