|
@@ -267,7 +267,7 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
return;
|
|
|
|
|
|
|
|
|
- var signAnnot = AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
|
|
|
+ var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
|
|
|
if (signAnnot == null)
|
|
|
{
|
|
|
if (annot.EventType == AnnotArgsType.AnnotStamp)
|
|
@@ -294,13 +294,13 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
if (StrAnnotToolChecked == "Signature")
|
|
|
{
|
|
|
- if (AnnotSignatures == null)
|
|
|
- AnnotSignatures = new List<Tuple<int, int>>();
|
|
|
+ if (viewContentViewModel.AnnotSignatures == null)
|
|
|
+ viewContentViewModel.AnnotSignatures = new List<Tuple<int, int>>();
|
|
|
|
|
|
- var signAnnot = AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
|
|
|
+ var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
|
|
|
if (signAnnot == null)
|
|
|
{
|
|
|
- AnnotSignatures.Add(new Tuple<int, int>(annot.PageIndex, annot.AnnotIndex));
|
|
|
+ viewContentViewModel.AnnotSignatures.Add(new Tuple<int, int>(annot.PageIndex, annot.AnnotIndex));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -779,6 +779,43 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
{
|
|
|
if (e != null && e.Count > 0)
|
|
|
{
|
|
|
+ Dictionary<int, List<int>> selectAnnotDicts = new Dictionary<int, List<int>>();
|
|
|
+ int count = 0;
|
|
|
+ foreach (var item in e)
|
|
|
+ {
|
|
|
+ if(item.EditAction == ActionType.Add)
|
|
|
+ selectAnnotDicts.Add(count, new List<int>() { item.PageIndex, item.AnnotIndex });
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+ if(selectAnnotDicts.Count > 0)
|
|
|
+ {
|
|
|
+ var annot = e[0].EditAnnotArgs;
|
|
|
+ if (
|
|
|
+ annot.EventType == AnnotArgsType.AnnotSquare ||
|
|
|
+ annot.EventType == AnnotArgsType.AnnotCircle ||
|
|
|
+ annot.EventType == AnnotArgsType.AnnotLine ||
|
|
|
+ annot.EventType == AnnotArgsType.AnnotStamp ||
|
|
|
+ annot.EventType == AnnotArgsType.AnnotFreeText
|
|
|
+ )
|
|
|
+ {
|
|
|
+ PDFViewer.ClearSelectAnnots();
|
|
|
+ if (StrAnnotToolChecked != "Signature")
|
|
|
+ {
|
|
|
+ PDFViewer.SelectAnnotation(selectAnnotDicts);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AddAnnotSignature(annot);
|
|
|
+ PDFViewer.SelectAnnotation(selectAnnotDicts);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (int i = 0; i < e.Count; i++)
|
|
|
{
|
|
|
AnnotEditEvent editEvent = e[i];
|
|
@@ -800,25 +837,25 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var annot = e[0].EditAnnotArgs;
|
|
|
- if (
|
|
|
- annot.EventType == AnnotArgsType.AnnotSquare ||
|
|
|
- annot.EventType == AnnotArgsType.AnnotCircle ||
|
|
|
- annot.EventType == AnnotArgsType.AnnotLine ||
|
|
|
- annot.EventType == AnnotArgsType.AnnotStamp
|
|
|
- )
|
|
|
- {
|
|
|
- PDFViewer.ClearSelectAnnots();
|
|
|
- if (StrAnnotToolChecked != "Signature")
|
|
|
- {
|
|
|
- PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- AddAnnotSignature(annot);
|
|
|
- PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
|
|
|
- }
|
|
|
- }
|
|
|
+ //var annot = e[0].EditAnnotArgs;
|
|
|
+ //if (
|
|
|
+ // annot.EventType == AnnotArgsType.AnnotSquare ||
|
|
|
+ // annot.EventType == AnnotArgsType.AnnotCircle ||
|
|
|
+ // annot.EventType == AnnotArgsType.AnnotLine ||
|
|
|
+ // annot.EventType == AnnotArgsType.AnnotStamp
|
|
|
+ // )
|
|
|
+ //{
|
|
|
+ // PDFViewer.ClearSelectAnnots();
|
|
|
+ // if (StrAnnotToolChecked != "Signature")
|
|
|
+ // {
|
|
|
+ // PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // AddAnnotSignature(annot);
|
|
|
+ // PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
|
|
|
break;
|
|
@@ -897,6 +934,7 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
{
|
|
|
if (sender != null && PDFViewer.ToolTip != null && PDFViewer.Parent != null)
|
|
|
{
|
|
|
+ //鼠标移到注释之外,关闭ToolTip浮窗
|
|
|
var newPoint = e.GetPosition(PDFViewer.Parent as ContentControl);
|
|
|
var isOutw = newPoint.X > (oldRect.X + oldRect.Width + 4);
|
|
|
var isOuth = newPoint.Y > (oldRect.Y + oldRect.Height + 4);
|