Просмотр исходного кода

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

chenrongqian@kdanmobile.com 1 год назад
Родитель
Сommit
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);