|
@@ -70,7 +70,7 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
public List<List<Point>> ShapePoints = new List<List<Point>>();
|
|
|
public string Shape = "HookShape";
|
|
|
private bool IsFillAndSign
|
|
|
- {get;set;} = true;
|
|
|
+ { get; set; } = true;
|
|
|
private PopMenu FreeHandAnnotPopMenu;
|
|
|
private PopMenu FreeTextAnnotPopMenu;
|
|
|
private PopMenu MultiAnnotPopMenu;
|
|
@@ -83,9 +83,10 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
public double FillOpacity = 1;
|
|
|
public double LineWidth = 2;
|
|
|
public double LineWidthMultiple = 1;
|
|
|
-
|
|
|
- public bool IsClickNull=false;
|
|
|
-
|
|
|
+ public bool IsSelectShape = false;
|
|
|
+ public bool IsCopyShape = false;
|
|
|
+ public bool IsClickNull = false;
|
|
|
+ private List<string> ShapeNames = new List<string>();
|
|
|
private string DateOrText = "";
|
|
|
|
|
|
private bool _HookShapeIsCheck = false;
|
|
@@ -772,8 +773,10 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
- freehandArgs = selectedArgs[0] as FreehandAnnotArgs;
|
|
|
+ if (IsCopyShape) {
|
|
|
+ ShapeNames.Clear();
|
|
|
+ }
|
|
|
+ freehandArgs = selectedArgs[0] as FreehandAnnotArgs;
|
|
|
foreach (var item in selectedArgs)
|
|
|
{
|
|
|
|
|
@@ -782,12 +785,17 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
{
|
|
|
if ((item as FreehandAnnotArgs).PageIndex == point.PageIndex && (item as FreehandAnnotArgs).AnnotIndex == point.AnnotIndex)
|
|
|
{
|
|
|
-
|
|
|
+ if (IsCopyShape)
|
|
|
+ {
|
|
|
+ ShapeNames.Add(point.Shape);
|
|
|
+ }
|
|
|
+
|
|
|
newSelectedArgs.Add(item);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ IsCopyShape = false;
|
|
|
//freehandArgs.RawPointList = ShapePoints;
|
|
|
//freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
|
|
|
//freehandArgs.Transparency = 1;
|
|
@@ -1236,7 +1244,11 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
{
|
|
|
if (e.AnnotEventArgsList == null || (PDFViewer != null && PDFViewer.MouseMode == MouseModes.FormEditTool))
|
|
|
return;
|
|
|
-
|
|
|
+ if ((UIElement)sender != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ CommandManager.AddPreviewExecutedHandler((UIElement)sender, PreviewExcute);
|
|
|
+ }
|
|
|
switch (e.CommandType)
|
|
|
{
|
|
|
case CommandType.Context:
|
|
@@ -1548,9 +1560,33 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
switch (editEvent.EditAction)
|
|
|
{
|
|
|
case ActionType.Add:
|
|
|
+ if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotFreehand) {
|
|
|
+ if (IsSelectShape)
|
|
|
+ {
|
|
|
+
|
|
|
|
|
|
- if (Shape != "None") { if (Shape == "Sign") { viewContentViewModel.AnnotSignatures.Add(new Tuple<int, int>(pageindex, annotindex)); } else { viewContentViewModel.FillAndSign.Add(new FillAndSignIsShape(pageindex, annotindex, Shape)); } }
|
|
|
- PDFViewer.SelectAnnotation(pageindex, annotindex);
|
|
|
+ viewContentViewModel.FillAndSign.Add(new FillAndSignIsShape(pageindex, annotindex, ShapeNames[i]));
|
|
|
+ //PDFViewer.SelectAnnotation(pageindex, annotindex);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (editEvent.EditAnnotArgs.EventType == AnnotArgsType.AnnotStamp)
|
|
|
+ {
|
|
|
+ if (Shape != "None")
|
|
|
+ {
|
|
|
+ if (Shape == "Sign")
|
|
|
+ {
|
|
|
+ viewContentViewModel.AnnotSignatures.Add(new Tuple<int, int>(pageindex, annotindex));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ viewContentViewModel.FillAndSign.Add(new FillAndSignIsShape(pageindex, annotindex, Shape));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PDFViewer.SelectAnnotation(pageindex, annotindex);
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case ActionType.Del:
|
|
|
if (Shape != "None")
|
|
@@ -1576,6 +1612,7 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ IsSelectShape = false;
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1585,7 +1622,7 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
{
|
|
|
if (e != null)
|
|
|
{
|
|
|
- IsClickNull=false;
|
|
|
+ IsClickNull = false;
|
|
|
var annot = e.AnnotItemsList[0];
|
|
|
if (annot != null)
|
|
|
{
|
|
@@ -1815,6 +1852,19 @@ namespace PDF_Master.ViewModels.FillAndSign
|
|
|
private void ShowPropertyPanel(bool show = true)
|
|
|
{
|
|
|
viewContentViewModel.IsPropertyOpen = show;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void PreviewExcute(object sender, ExecutedRoutedEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Command == ApplicationCommands.Paste)
|
|
|
+ {
|
|
|
+ IsSelectShape = true;
|
|
|
+ }
|
|
|
+ if (e.Command == ApplicationCommands.Copy)
|
|
|
+ {
|
|
|
+
|
|
|
+ IsCopyShape = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#region Navigation
|