浏览代码

注释 - 复制粘贴并选中注释

chenrongqian@kdanmobile.com 1 年之前
父节点
当前提交
b6c4b48103
共有 1 个文件被更改,包括 28 次插入22 次删除
  1. 28 22
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

+ 28 - 22
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -784,35 +784,41 @@ namespace PDF_Office.ViewModels.Tools
                 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")
+                        var annot = item.EditAnnotArgs;
+                        if (
+                     annot.EventType == AnnotArgsType.AnnotSquare ||
+                     annot.EventType == AnnotArgsType.AnnotCircle ||
+                     annot.EventType == AnnotArgsType.AnnotLine ||
+                     annot.EventType == AnnotArgsType.AnnotStamp ||
+                     annot.EventType == AnnotArgsType.AnnotFreeText
+                     )
                         {
-                            PDFViewer.SelectAnnotation(selectAnnotDicts);
-                        }
-                        else
-                        {
-                            AddAnnotSignature(annot);
-                            PDFViewer.SelectAnnotation(selectAnnotDicts);
+                            if (selectAnnotDicts.ContainsKey(item.PageIndex) == false)
+                            {
+                                selectAnnotDicts.Add(item.PageIndex, new List<int>());
+                                selectAnnotDicts[item.PageIndex].Add(item.AnnotIndex);
+                            }
+                            else
+                            {
+                                selectAnnotDicts[item.PageIndex].Add(item.AnnotIndex);
+                            }
+
+                            count++;
                         }
+                           
                     }
+                   
                 }
-                
 
+               
+                if (StrAnnotToolChecked == "Signature")
+                {
+                    //AddAnnotSignature(annot);
+                }
 
+                PDFViewer.ClearSelectAnnots();
+                PDFViewer.SelectAnnotation(selectAnnotDicts);