Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng 2 years ago
parent
commit
4a072d0cf3
24 changed files with 898 additions and 527 deletions
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 1 1
      PDF Office/EventAggregators/FillAndSignEvent.cs
  3. 1 1
      PDF Office/Helper/CropPageUndoManager.cs
  4. 15 15
      PDF Office/Helper/SecurityHelper.cs
  5. 19 2
      PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogModel.cs
  6. 26 0
      PDF Office/Model/FillAndSign/FillAndSignContentModel.cs
  7. 1 0
      PDF Office/PDF Office.csproj
  8. 8 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  9. 3 0
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs
  10. 209 48
      PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs
  11. 122 26
      PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs
  12. 1 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  13. 2 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  14. 2 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  15. 1 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  16. 1 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs
  17. 77 25
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  18. 5 5
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  19. 0 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  20. 1 1
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  21. 45 35
      PDF Office/ViewModels/ViewContentViewModel.cs
  22. 1 0
      PDF Office/Views/BOTA/BookmarkContent.xaml
  23. 333 333
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  24. 24 23
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 1 - 1
PDF Office/EventAggregators/FillAndSignEvent.cs

@@ -11,7 +11,7 @@ namespace PDF_Office.EventAggregators
 
     public class FillAndSigntEventArgs
     {
-        public string Unicode { get; set; }
+        public string Action { get; set; }
         public string AppUnicode { get; set; }
         public List<AnnotHandlerEventArgs> Annots { get; set; }
 

+ 1 - 1
PDF Office/Helper/CropPageUndoManager.cs

@@ -58,7 +58,7 @@ namespace PDF_Office.Helper
             if (cropPageEnumIndex != cropPageEnumList.Count - 1)
             {
                 cropPageEnumList.RemoveRange(cropPageEnumIndex+1, cropPageEnumList.Count - cropPageEnumIndex-1);
-                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-37, cropPageListInterval);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval- pdfviewer.Document.PageCount, cropPageListInterval);
                 cropPageListInterval = 0;
             }
             

+ 15 - 15
PDF Office/Helper/SecurityHelper.cs

@@ -159,25 +159,25 @@ namespace PDF_Office.Helper
             {
                 verifyPasswordResult.IsDiscryptied = true;
                 verifyPasswordResult.Password = null;
-                return verifyPasswordResult;
-            }
-
-            DialogParameters value = new DialogParameters();
-            if (enumPermissionsSet == EnumPermissionsSet.None)
-            {
-                value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusOpenPassword);
-
             }
             else
             {
-                value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
+                DialogParameters value = new DialogParameters();
+                if (CheckHaveSelectedPermissions(document, enumPermissionsSet))
+                {
+                    value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusOpenPassword);
+                }
+                else
+                {
+                    value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
+                }
+                value.Add(ParameterNames.PDFDocument, document);
+                dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
+                {
+                    verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
+                    verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
+                });
             }
-            value.Add(ParameterNames.PDFDocument, document);
-            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
-            {
-                verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
-                verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
-            });
             return verifyPasswordResult;
         }
     }

+ 19 - 2
PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit.PDFDocument;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,7 +9,23 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
 {
     public class CheckPasswordDialogModel
     {
+        static public Dictionary<EnumPermissionsSet, bool> InitHavePermissionsInfo(CPDFDocument document)
+        {
+            Dictionary<EnumPermissionsSet, bool> GetHavePermissionsFromPermissionsSet = new Dictionary<EnumPermissionsSet, bool>();
+            GetHavePermissionsFromPermissionsSet.Clear();
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentChanges, document.GetPermissionsInfo().AllowsDocumentChanges);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsPrinting, document.GetPermissionsInfo().AllowsPrinting);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsHighQualityPrinting, document.GetPermissionsInfo().AllowsHighQualityPrinting);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCopying, document.GetPermissionsInfo().AllowsCopying);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentAssembly, document.GetPermissionsInfo().AllowsDocumentAssembly);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsFormFieldEntry, document.GetPermissionsInfo().AllowsFormFieldEntry);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCommenting, document.GetPermissionsInfo().AllowsCommenting);
+            return GetHavePermissionsFromPermissionsSet;
+        }
     }
+
+
+
     public enum EnumPermissionsSet
     {
         None = 0,
@@ -20,5 +37,5 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
         StatusAllowsFormFieldEntry  = 1<<6,
         StatusAllowsCommenting = 1<<7
     }
-    
+
 }

+ 26 - 0
PDF Office/Model/FillAndSign/FillAndSignContentModel.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.FillAndSign
+{
+    public class FillAndSignContentModel
+    {
+    }
+
+    public class FillAndSignIsShape
+    {
+        public FillAndSignIsShape(int PageIndex, int AnnotIndex, string Shape)
+        {
+            this.PageIndex = PageIndex;
+            this.AnnotIndex = AnnotIndex;
+            this.Shape = Shape;
+        }
+        public int PageIndex;
+        public int AnnotIndex;
+        public string Shape;
+
+    }
+}

+ 1 - 0
PDF Office/PDF Office.csproj

@@ -447,6 +447,7 @@
     <Compile Include="Model\EditTools\HeaderFooter\HeaderFooterCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkTemplateListModel.cs" />
+    <Compile Include="Model\FillAndSign\FillAndSignContentModel.cs" />
     <Compile Include="Model\From\FormFieldType.cs" />
     <Compile Include="Model\PageEdit\CustomInsertModel.cs" />
     <Compile Include="Model\PageEdit\CustomPageItem.cs" />

+ 8 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1024,10 +1024,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 if (result.Password != null)
                 {
                     string filePath = PDFViewer.Document.FilePath;
-                    PDFViewer.CloseDocument();
-                    PDFViewer.InitDocument(filePath);
-                    PDFViewer.Document.UnlockWithPassword(result.Password);
-                    PDFViewer.Load();
+                    if (PDFViewer.Document.IsLocked)
+                    {
+                        PDFViewer.Document.UnlockWithPassword(result.Password);
+                    }
+                    else
+                    {
+                        PDFViewer.Document.CheckOwnerPassword(result.Password);
+                    }
                 }
                 ///TODO:
                 ///此处填入需要执行的代码

+ 3 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs

@@ -1,10 +1,13 @@
 using ComPDFKit.PDFDocument;
+using Microsoft.Office.Interop.Word;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
 using System;
+using System.Collections.Generic;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 
 using Visibility = System.Windows.Visibility;

+ 209 - 48
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -53,6 +53,7 @@ using Size = System.Windows.Size;
 using System.Windows.Markup;
 using Prism.Services.Dialogs;
 using PDF_Office.ViewModels.Tools.AnnotManager;
+using PDF_Office.Model.FillAndSign;
 
 namespace PDF_Office.ViewModels.FillAndSign
 {
@@ -61,15 +62,21 @@ namespace PDF_Office.ViewModels.FillAndSign
         #region 
         public CPDFViewer PDFViewer;
         private AnnotTransfer propertyPanel = new AnnotTransfer();
-        private ViewContentViewModel viewContentViewModel;
+        public ViewContentViewModel viewContentViewModel;
         private bool isRightMenuAddAnnot = false;
         private IEventAggregator events;
         public List<List<Point>> ShapePoints = new List<List<Point>>();
-        private string Shape = "HookShape";
+        public string Shape = "HookShape";
+        private bool IsFillAndSign
+        {
+            get;
+
+            set;
+        } = true;
         private PopMenu FreeHandAnnotPopMenu;
         private PopMenu FreeTextAnnotPopMenu;
         private PopMenu MultiAnnotPopMenu;
-        public bool isFirst=true;
+        public bool isFirst = true;
         private IRegionManager regions { get; set; }
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         public static bool IsEdit = false;
@@ -109,7 +116,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         string Unicode = "";
         public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events) { }
 
-        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events,IDialogService dialogService)
+        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events, IDialogService dialogService)
         {
             dialogs = dialogService;
             regions = regionManager;
@@ -126,6 +133,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             InitSelectFreeTextAnnotMenu();
             InitSelectMultiAnnotMenu();
             SubscribeEvent();
+            InitShapeList();
         }
 
         #region 事件聚合器(来自AnnotToolContentViewModel)
@@ -136,29 +144,31 @@ namespace PDF_Office.ViewModels.FillAndSign
 
         private void FromFillAndSign(FillAndSigntEventArgs obj)
         {
-            if(obj != null)
+            if (obj != null)
             {
-                if(string.IsNullOrEmpty(obj.Unicode) == false)
+                if (string.IsNullOrEmpty(obj.Action) == false)
                 {
-                    if(obj.Unicode == "Clear")
+                    if (obj.Action == "Clear")
                     {
                         viewContentViewModel.FillAndSign.Clear();
                     }
                     else
                     {
-                        if(obj.Annots != null && obj.Annots.Count > 0)
+                        if (obj.Annots != null && obj.Annots.Count > 0)
                         {
                             if (obj.Annots[0].EventType == AnnotArgsType.AnnotFreehand)
                             {
+                                IsFillAndSign = false;
                                 GetFreehand(obj.Annots);
+
                             }
-                            else if(obj.Annots[0].EventType == AnnotArgsType.AnnotFreeText)
+                            else if (obj.Annots[0].EventType == AnnotArgsType.AnnotFreeText)
                             {
                                 GetFreetext(obj.Annots);
                             }
                         }
                     }
-                   
+
                 }
             }
         }
@@ -381,7 +391,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             }
         }
 
-        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType,string savaKey="")
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType, string savaKey = "")
         {
             var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType, savaKey);
             if (Annot == null)
@@ -394,13 +404,13 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void CheckedEvent(object e)
         {
 
-            var control = e as Control;
-        
-            IsEdit = false;
-            
-
-            //NavigateToProperty(control.Name);
-            //不创建注释,属于注释模板
+            var control = e as Control;
+
+            IsEdit = false;
+
+
+            //NavigateToProperty(control.Name);
+            //不创建注释,属于注释模板
             bool isTemplateAnnot = false;
             bool isSnapshotEdit = false;
             AnnotHandlerEventArgs annotArgs = null;
@@ -457,7 +467,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void InitCheckedEvent(string e)
         {
             IsEdit = false;
-           
+
 
             //NavigateToProperty(control.Name);
             //不创建注释,属于注释模板
@@ -507,19 +517,30 @@ namespace PDF_Office.ViewModels.FillAndSign
                     ShowPropertyPanel(true);
                 }
             }
-         
+
+        }
+        private List<string> ShapeList = new List<string>();
+        private void InitShapeList()
+        {
+            ShapeList.Add("HookShape");
+            ShapeList.Add("ForkShape");
+            ShapeList.Add("RectShape");
+            ShapeList.Add("LineShape");
+            ShapeList.Add("DotShape");
+            ShapeList.Add("Sign");
         }
         //注释工具
         private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs, bool isRightMenuAdd = false)
         {
             LineWidthMultiple = 1;
             IsSignPoint = false;
+            Shape = "None";
             switch (tag)
             {
 
-                case "RbtnDate":
-                        DateOrText = "Freetext";
-                        annotArgs = GetFreetext();
+                case "RbtnDate":
+                    DateOrText = "Freetext";
+                    annotArgs = GetFreetext();
                     break;
                 case "RbtnText"://文本
                     DateOrText = "";
@@ -529,8 +550,10 @@ namespace PDF_Office.ViewModels.FillAndSign
                     annotArgs = GetFreetext();
                     break;
                 case "RbtnSign"://签名
+                    Shape = "Sign";
+                    PDFViewer.SetMouseMode(MouseModes.PanTool);
                     annotArgs = GetSignature();
-                    PDFViewer.SetMouseMode(MouseModes.PanTool);//清空其他注释
+                    //清空其他注释
                     break;
                 case "RbtnTick"://勾
                     Shape = "HookShape";
@@ -599,7 +622,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             List<AnnotHandlerEventArgs> stampAnnotArgsList = new List<AnnotHandlerEventArgs>();
             if (stampAnnotArgs != null)
                 stampAnnotArgsList.Add(stampAnnotArgs);
-           
+
             //if (selectedArgs != null) { 
             //var annot = selectedArgs[0];
             //if (annot != null)
@@ -621,7 +644,10 @@ namespace PDF_Office.ViewModels.FillAndSign
         public void SetStamp()
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
+            double lineWidthMultiple = LineWidthMultiple;
+            if (Shape == "DotShape") { LineWidthMultiple = 5; }
             stampAnnotArgs.SetInkData(ShapePoints, LineWidth * LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
+            LineWidthMultiple = lineWidthMultiple;
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -649,7 +675,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 annotArgs.Author = Settings.Default.AppProperties.Description.Author;
                 PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                 PDFViewer.SetToolParam(annotArgs);
-                
+
                 isRightMenuAddAnnot = false;
             }
 
@@ -718,7 +744,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                     //if (ListPoint((item as FreehandAnnotArgs).RawPointList, ShapePoints)){
                     foreach (var point in viewContentViewModel.FillAndSign)
                     {
-                        if ((item as FreehandAnnotArgs).PageIndex == point.Item1 && (item as FreehandAnnotArgs).AnnotIndex == point.Item2)
+                        if ((item as FreehandAnnotArgs).PageIndex == point.PageIndex && (item as FreehandAnnotArgs).AnnotIndex == point.AnnotIndex)
                         {
 
                             newSelectedArgs.Add(item);
@@ -726,10 +752,10 @@ namespace PDF_Office.ViewModels.FillAndSign
                     }
 
                 }
-                freehandArgs.RawPointList = ShapePoints;
-                freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
-                freehandArgs.Transparency = 1;
-                freehandArgs.LineWidth = LineWidth;
+                //freehandArgs.RawPointList = ShapePoints;
+                //freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
+                //freehandArgs.Transparency = 1;
+                //freehandArgs.LineWidth = LineWidth;
                 annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
                 annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
                 annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
@@ -866,19 +892,94 @@ namespace PDF_Office.ViewModels.FillAndSign
                 if (annots.Count > 1)
                 {
                     if (propertyPanel.AnnotEvents == null)
-                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
-                    
+                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
+
                     propertyPanel.AnnotEvents.Clear();
 
                     foreach (var itemAnnot in annots)
-                    {
+                    {
+                        for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                        {
+                            //annotAttribsList = itemAnnot.GetAnnotAttrib();
+                            //annotAttribsList[AnnotAttrib.Width] = (itemAnnot as FreehandAnnotArgs).Width;
+                            //annotAttribsList[AnnotAttrib.Height] = (itemAnnot as FreehandAnnotArgs).Height;
+                            if (viewContentViewModel.FillAndSign[j].PageIndex == itemAnnot.PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == itemAnnot.AnnotIndex)
+                            {
+                                FreehandAnnotArgs freehandArgs = null;
+                                freehandArgs = itemAnnot as FreehandAnnotArgs;
+                                annotAttribsList = itemAnnot.GetAnnotAttrib();
+                                annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                                annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                                annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                                annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                                annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                                annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                                annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[0])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[1])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[2])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[3])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[4])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                                //}
+                            }
+                        }
                         var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
                         //PDFViewer.SelectAnnotation(itemAnnot.PageIndex, itemAnnot.AnnotIndex);
                         propertyPanel.AnnotEvents.Add(eventitem);
 
                     }
                 }
-
+                for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                {
+
+                    if (viewContentViewModel.FillAndSign[j].PageIndex == annots[0].PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == annots[0].AnnotIndex)
+                    {
+                        FreehandAnnotArgs freehandArgs = null;
+                        freehandArgs = annots[0] as FreehandAnnotArgs;
+                        annotAttribsList = annots[0].GetAnnotAttrib();
+                        annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                        annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                        annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                        annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                        annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                        annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                        annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[0])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[1])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[2])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[3])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[4])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                        //}
+                    }
+                }
                 propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
                 if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
                 {
@@ -901,9 +1002,10 @@ namespace PDF_Office.ViewModels.FillAndSign
 
                 if (isUpData) { return; }
 
-                if (viewContent == "ShapFillProperty") {
-                    
-                    NavigateToProperty(viewContent, propertyPanel); return; }
+                if (viewContent == "ShapFillProperty")
+                {
+                    NavigateToProperty(viewContent, propertyPanel); return;
+                }
                 viewContentViewModel.SelectedPrpoertyPanel(viewContent, propertyPanel);
             }
 
@@ -914,6 +1016,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             NavigationParameters values = new NavigationParameters();
             values.Add(ParameterNames.PDFViewer, PDFViewer);
             values.Add(ParameterNames.PropertyPanelContentViewModel, annotPropertyPanel);
+            values.Add("IsFillAndSign", IsFillAndSign);
             values.Add("Shape", Shape);
             values.Add("FillAndSignContentViewModel", this);
             regions.RequestNavigate(RegionNames.PropertyRegionName, btnName, values);
@@ -1164,9 +1267,9 @@ namespace PDF_Office.ViewModels.FillAndSign
 
                                     case AnnotArgsType.AnnotFreehand:
                                         e.PopupMenu = FreeHandAnnotPopMenu.OpenMenu(selectedAnnot, sender);
-                                        break;
-                                        case AnnotArgsType.AnnotFreeText:
-                                        e.PopupMenu= FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
+                                        break;
+                                    case AnnotArgsType.AnnotFreeText:
+                                        e.PopupMenu = FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
 
                                 }
@@ -1480,13 +1583,36 @@ namespace PDF_Office.ViewModels.FillAndSign
                 for (int i = 0; i < e.Count; i++)
                 {
                     AnnotEditEvent editEvent = e[i];
+                    int pageindex = editEvent.PageIndex;
+                    int annotindex = editEvent.AnnotIndex;
                     switch (editEvent.EditAction)
                     {
                         case ActionType.Add:
-                            int pageindex = editEvent.PageIndex;
-                            int annotindex = editEvent.AnnotIndex;
-                            viewContentViewModel.FillAndSign.Add(new Tuple<int,int>(pageindex, annotindex));
-                             PDFViewer.SelectAnnotation(pageindex, annotindex);
+
+                            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")
+                            {
+                                for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                                {
+                                    if (viewContentViewModel.FillAndSign[j].PageIndex == pageindex && viewContentViewModel.FillAndSign[j].AnnotIndex == annotindex)
+                                    {
+
+                                        viewContentViewModel.FillAndSign.Remove(viewContentViewModel.FillAndSign[j]);
+                                    }
+                                }
+                                for (int j = 0; j < viewContentViewModel.AnnotSignatures.Count; j++)
+                                {
+                                    if (viewContentViewModel.AnnotSignatures[j].Item1 == pageindex && viewContentViewModel.AnnotSignatures[j].Item2 == annotindex)
+                                    {
+
+                                        viewContentViewModel.AnnotSignatures.Remove(viewContentViewModel.AnnotSignatures[j]);
+                                    }
+                                }
+                            }
+
                             break;
                     }
                 }
@@ -1551,7 +1677,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                             else
                             {
                                 ShowPropertyPanel();
-                               
+
                             }
                         }
                     }
@@ -1676,10 +1802,44 @@ namespace PDF_Office.ViewModels.FillAndSign
             {
 
                 case AnnotArgsType.AnnotFreeText:
+
                     GetFreetext(e.AnnotItemsList);
                     break;
 
                 case AnnotArgsType.AnnotFreehand:
+                   
+                    bool isDifferen = false;
+                    foreach (var point in viewContentViewModel.FillAndSign)
+                    {
+                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                        {
+                            isDifferen = true;
+                            break;
+                        }
+                        else
+                        {
+                            isDifferen = false;
+                        }
+                    }
+                    if (!isDifferen)
+                    {
+                        foreach (var point in viewContentViewModel.AnnotSignatures)
+                        {
+                            if (annot.PageIndex == point.Item1 && annot.AnnotIndex == point.Item2)
+                            {
+                                isDifferen = true;
+                                break;
+                            }
+                            else
+                            {
+                                isDifferen = false;
+                            }
+                        }
+                        if (isDifferen)
+                        {
+                            ShowPropertyPanel(true); AddToPropertyPanel("SignatureAnnotProperty"); return; }
+                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); return;
+                    }
                     GetFreehand(e.AnnotItemsList);
                     break;
 
@@ -1714,10 +1874,11 @@ namespace PDF_Office.ViewModels.FillAndSign
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            IsFillAndSign = true;
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
-            BindingPDFViewerHandler();
-           HookShapeIsCheck = true;
+            BindingPDFViewerHandler();
+            HookShapeIsCheck = true;
             HookShapeIsCheck = false;
             InitFillAndSignProperty();
             ShowPropertyPanel(false);

+ 122 - 26
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -22,6 +22,7 @@ using static Dropbox.Api.UsersCommon.AccountType;
 using PDF_Office.Model.AnnotPanel;
 using PDFSettings;
 using PDF_Office.ViewModels.Tools.AnnotManager;
+using Prism.Common;
 
 namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 {
@@ -33,6 +34,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
         private FillAndSignContentViewModel fillAndSignContentViewModel;
         public List<List<Point>> updatapath = new List<List<Point>>();
         private Geometry dataPath = null;
+        private bool IsFillAndSign = false;
+        public string Shape = "";
         public Geometry DataPath
         {
             get { return dataPath; }
@@ -58,12 +61,13 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     fillAndSignContentViewModel.SelectColor = value;
                     //if (FillAndSignContentViewModel.IsEdit)
                     {
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
                     }
                     //else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if(IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -89,7 +93,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
                     //else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -109,8 +114,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
         {
             get { return _isSelected; }
             set => SetProperty(ref _isSelected, value);
-        }
-
+        }
+        private double lineWidthMultiple=1;
         private double lineWidth = 1;
         public double LineWidth
         {
@@ -127,13 +132,16 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
                         //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
                         //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                       // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        //if (Shape == "DotShape") { lineWidthMultiple = 5; }
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                        //fillAndSignContentViewModel.LineWidthMultiple = lineWidthMultiple;
+                         //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
 
                     }
-                   // else
+                    // else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -194,8 +202,9 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
         private void SharpsType(string tag, object obj, bool isFromToolsBtn = false)
         {
-            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
             fillAndSignContentViewModel.LineWidthMultiple = 1;
+            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+            lineWidthMultiple = 1;
             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
             switch (tag)
@@ -210,6 +219,20 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                         updatapath = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
 
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                        {
+                            foreach (var annot in PropertyPanel.annotlists)
+                            {
+
+                                foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                {
+                                    if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                    {
+                                        point.Shape = "HookShape";
+                                    }
+                                }
+                            }
+                        }
                     }
                     //PropertyPanel.UpdateAnnotAAttrib();
                     //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
@@ -221,11 +244,26 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     var forkShape = new PathGeometry();
                     forkShape.AddGeometry(Geometry.Parse("M3.19995 3.20001L12.8 12.8 M12.8 3.20001L3.20005 12.8"));
                     DataPath = forkShape;
-                   // if (FillAndSignContentViewModel.IsEdit)
+                    // if (FillAndSignContentViewModel.IsEdit)
                     {
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                         updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                        {
+                            foreach (var annot in PropertyPanel.annotlists)
+                            {
+
+                                foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                {
+                                    if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                    {
+                                        point.Shape = "ForkShape";
+                                    }
+                                }
+                            }
+                        }
+
                     }
                     //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                     //fillAndSignContentViewModel.SetStamp();
@@ -242,6 +280,20 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                             updatapath = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
+
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "RectShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.19995, 5), new Point(28, 5), new Point(28, 27), new Point(0.19995, 27), new Point(0.19995, 5) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -254,11 +306,25 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                         var lineShape = new PathGeometry();
                         lineShape.AddGeometry(Geometry.Parse(" M0,10L20,10"));
                         DataPath = lineShape;
-                       // if (FillAndSignContentViewModel.IsEdit)
+                        // if (FillAndSignContentViewModel.IsEdit)
                         {
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                             updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
+
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "LineShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(12.19995, 10), new Point(36, 10) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -268,19 +334,33 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     break;
 
                 case "DotShape":
-                    {
+                    {
+                        fillAndSignContentViewModel.LineWidthMultiple = 5;
                         EllipseGeometry circlePath = new EllipseGeometry();
                         circlePath.RadiusX = 2.4;
                         circlePath.RadiusY = 2.4;
                         circlePath.Center = new Point(2.4, 2.4);
                         DataPath = circlePath;
-                       // if (FillAndSignContentViewModel.IsEdit)
+                        // if (FillAndSignContentViewModel.IsEdit)
                         {
-                            fillAndSignContentViewModel.LineWidthMultiple = 4;
+                            lineWidthMultiple = 5;
                             updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
-                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
+                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * 5);
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
 
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "DotShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.19995, 1.19995), new Point(0.19995, -1.19995) }, new List<Point> { new Point(-0.25995, 0.89995), new Point(0.25995, -0.89995) }, new List<Point> { new Point(-1.19995, 0.19995), new Point(0.19995, 1.19995) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -297,7 +377,7 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
         private void InitSharpsType(string tag)
         {
-
+            fillAndSignContentViewModel.LineWidthMultiple = 1;
             switch (tag)
             {
                 case "HookShape":
@@ -330,7 +410,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     break;
 
                 case "DotShape":
-                    {
+                    {
+                        fillAndSignContentViewModel.LineWidthMultiple = 5;
                         EllipseGeometry circlePath = new EllipseGeometry();
                         circlePath.RadiusX = 2.4;
                         circlePath.RadiusY = 2.4;
@@ -423,6 +504,9 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
             navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             navigationContext.Parameters.TryGetValue<FillAndSignContentViewModel>("FillAndSignContentViewModel", out fillAndSignContentViewModel);
             navigationContext.Parameters.TryGetValue<string>("Shape", out shape);
+            bool isFillAndSign = false;
+            navigationContext.Parameters.TryGetValue<bool>("IsFillAndSign", out isFillAndSign);
+            IsFillAndSign = isFillAndSign;
             InitSharpsType(shape);
             //FillAndSignContentViewModel.IsEdit = false;
             if (PropertyPanel != null)
@@ -450,21 +534,33 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                 }
                 else
                 {
-                    GetAnnotProperty();
-                }
-
+                    GetAnnotProperty(shape);
+                }
+
             }
         }
 
-        private void GetAnnotProperty()
+        private void GetAnnotProperty(string shape)
         {
-            if (Annot is StickyAnnotArgs)
+            if (Annot is FreehandAnnotArgs)
             {
-                var annot = Annot as StickyAnnotArgs;
+                var annot = Annot as FreehandAnnotArgs;
                 if (annot != null)
                 {
-                    SelectColor = new SolidColorBrush(annot.Color);
-                    FillOpacity = annot.Transparency;
+                    //SelectColor = new SolidColorBrush(annot.InkColor);
+                    //FillOpacity = annot.Transparency;
+                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                    {
+                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                        {
+                            lineWidthMultiple = 1;
+                            if (point.Shape == "DotShape") {
+                                lineWidthMultiple = 5;
+                            }
+                            InitSharpsType(point.Shape);
+                            Shape=point.Shape;
+                        }
+                    }
                 }
 
             }

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -358,7 +358,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.InkColor.A != item.InkColor.A || temp.InkColor.R != item.InkColor.R || temp.InkColor.G != item.InkColor.G || temp.InkColor.B != item.InkColor.B)
                         {
-                            BasicVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["Color"] = true;
                         }
                     }

+ 2 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -591,7 +591,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.FontColor.A != item.FontColor.A || temp.FontColor.R != item.FontColor.R || temp.FontColor.G != item.FontColor.G || temp.FontColor.B != item.FontColor.B)
                         {
-                            FontVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                            FontVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FontColor"] = true;
                         }
                     }
@@ -600,7 +600,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.BgColor.A != item.BgColor.A || temp.BgColor.R != item.BgColor.R || temp.BgColor.G != item.BgColor.G || temp.BgColor.B != item.BgColor.B)
                         {
-                            BasicVm.FillColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FillColor"] = true;
                         }
                     }

+ 2 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -442,7 +442,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.BgColor.A != item.BgColor.A || temp.BgColor.R != item.BgColor.R || temp.BgColor.G != item.BgColor.G || temp.BgColor.B != item.BgColor.B)
                         {
-                            BasicVm.FillColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FillColor"] = true;
                         }
                     }
@@ -451,7 +451,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.LineColor.A != item.LineColor.A || temp.LineColor.R != item.LineColor.R || temp.LineColor.G != item.LineColor.G || temp.LineColor.B != item.LineColor.B)
                         {
-                            BasicVm.BorderColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.BorderColor = new SolidColorBrush(Color.FromArgb(0x01,0xff,0xff,0xff));
                             isNoEqualsDir["LineColor"] = true;
                         }
                     }

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -233,7 +233,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.Color.A != item.Color.A || temp.Color.R != item.Color.R || temp.Color.G != item.Color.G || temp.Color.B != item.Color.B)
                         {
-                            SharpColor = new SolidColorBrush(Colors.Transparent);
+                            SharpColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["SharpColor"] = true;
                         }
                     }

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -204,7 +204,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     }
                     else
                     {
-                        BasicVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                        BasicVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                     }
                     
                 }

+ 77 - 25
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -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,8 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (e != null && e.Count > 0)
             {
+                MultipleSelectionAnnot(e);
+
                 for (int i = 0; i < e.Count; i++)
                 {
                     AnnotEditEvent editEvent = e[i];
@@ -786,6 +788,7 @@ namespace PDF_Office.ViewModels.Tools
                     {
                         case ActionType.Add:
 
+                            //BOTA
                             bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
                             if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
@@ -800,27 +803,13 @@ 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
-                               )
+                            //添加书签注释,用于未保存前跟图章手绘注释的区分
+                            if (StrAnnotToolChecked == "Signature")
                             {
-                                PDFViewer.ClearSelectAnnots();
-                                if (StrAnnotToolChecked != "Signature")
-                                {
-                                    PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
-                                }
-                                else
-                                {
-                                    AddAnnotSignature(annot);
-                                    PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
-                                } 
+                                AddAnnotSignature(editEvent.EditAnnotArgs);
                             }
-
                             
+
                             break;
 
                         case ActionType.Del:
@@ -869,6 +858,47 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //复制多个注释,粘贴后,默认注释未选中状态
+        private void MultipleSelectionAnnot(List<AnnotEditEvent> e)
+        {
+            bool isAdd = false;
+            Dictionary<int, List<int>> selectAnnotDicts = new Dictionary<int, List<int>>();
+           
+            foreach (var item in e)
+            {
+                if (item.EditAction == ActionType.Add)
+                {
+                    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)
+                    {
+                        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);
+                        }
+
+                        isAdd = true;
+
+                    }
+
+                }
+
+            }
+
+            if (isAdd)
+            {
+                PDFViewer.ClearSelectAnnots();
+                PDFViewer.SelectAnnotation(selectAnnotDicts);
+            }
+
+        }
+
+        //阅读页悬浮相应
         private void PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
         {
             if (e != null && e.DrawContext != null)
@@ -897,6 +927,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);
@@ -929,11 +960,11 @@ namespace PDF_Office.ViewModels.Tools
                     oldRect = hoverRect;
                     PDFViewer.MouseMove -= PDFViewer_MouseMove;
                     PDFViewer.MouseMove += PDFViewer_MouseMove;
-                    return;
                 }
-
             }
         }
+
+        //关闭ToolTip
         private void CloseAnnotToolTip()
         {
             if (PDFViewer.ToolTip != null && PDFViewer.ToolTip is ToolTip)
@@ -985,6 +1016,7 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //来自属性面板的事件,更改颜色等属性而触发
         private void AnnotPropertyPanel_DataChanged(object sender, Dictionary<AnnotArgsType, object> e)
         {
             if (e != null)
@@ -1002,6 +1034,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 HighLightOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotUnderline:
@@ -1013,6 +1050,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 underLineOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotSquiggly:
@@ -1024,6 +1066,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 SquigglyOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotStrikeout:
@@ -1035,6 +1082,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 StrikeoutOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotFreehand:

+ 5 - 5
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -626,10 +626,10 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (viewContentViewModel.FillAndSign != null && viewContentViewModel.FillAndSign.Count > 0 && annots != null && annots.Count > 0)
             {
-                var annotFillAndSign = viewContentViewModel.FillAndSign.FirstOrDefault(temp => temp.Item1 == annots[0].PageIndex && temp.Item2 == annots[0].AnnotIndex);
+                var annotFillAndSign = viewContentViewModel.FillAndSign.FirstOrDefault(temp => temp.PageIndex == annots[0].PageIndex && temp.AnnotIndex == annots[0].AnnotIndex);
                 if (annotFillAndSign != null)
                 {
-                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Unicode = tag, AppUnicode = App.mainWindowViewModel.SelectedItem.Unicode, Annots = annots });
+                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Action = tag, AppUnicode = App.mainWindowViewModel.SelectedItem.Unicode, Annots = annots });
                     return true;
                 }
             }
@@ -640,11 +640,11 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (obj != null)
             {
-                if (string.IsNullOrEmpty(obj.Unicode) == false)
+                if (string.IsNullOrEmpty(obj.Action) == false)
                 {
-                    if (obj.Unicode == "Clear")
+                    if (obj.Action == "Clear")
                     {
-                        AnnotSignatures.Clear();
+                        viewContentViewModel.AnnotSignatures.Clear();
                     }
                 }
             }

+ 0 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -143,7 +143,6 @@ namespace PDF_Office.ViewModels.Tools
         private AnnotTransfer propertyPanel = new AnnotTransfer();
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
-        private List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
         private StickyNotePopup customStickyPopup;
         string Unicode = "";
 

+ 1 - 1
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -297,7 +297,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             await Task.Run(() =>
             {
-                if (PDFViewer.CurrentIndex > 0)
+                if (PDFViewer.CurrentIndex >= 0)
                 {
                     UndoManager.cropPageList.Add(PDFViewer.CurrentIndex);
                 }

+ 45 - 35
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -37,6 +37,7 @@ using PDF_Office.ViewModels.BOTA;
 using PDF_Office.Views.BOTA;
 using System.Drawing;
 using PDF_Office.ViewModels.Tools.AnnotManager;
+using PDF_Office.Model.FillAndSign;
 
 namespace PDF_Office.ViewModels
 {
@@ -247,9 +248,11 @@ namespace PDF_Office.ViewModels
 
         public string BackgroundContentRegionName { get; set; }
 
-        //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
-        public List<Tuple<int, int>> FillAndSign = new List<Tuple<int, int>>();
+        
 
+        //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
+        public List<FillAndSignIsShape> FillAndSign = new List<FillAndSignIsShape>();
+        public List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
         /// <summary>
         /// 文档的密码
         /// </summary>
@@ -550,7 +553,7 @@ namespace PDF_Office.ViewModels
             set
             {
                 if (events != null && canSave == false)
-                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Unicode = "Clear", AppUnicode = unicode });
+                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Action = "Clear", AppUnicode = unicode });
 
                 SetProperty(ref canSave, value);
             }
@@ -1995,43 +1998,45 @@ namespace PDF_Office.ViewModels
                     {
                         string currentPath = PDFViewer.Document.FilePath;
                         string tempPath = PDFViewer.Document.FilePath + ".temp.pdf";
-                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
-
-                        PDFViewer.Document.WriteToFilePath(tempPath);
-                        PDFViewer.CloseDocument();
-                        PDFViewer.InitDocument(tempPath);
-                        if (!string.IsNullOrEmpty(permissionsPassword))
+                        if (PDFViewer.Document.Descrypt(tempPath))
                         {
-                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
+                            PDFViewer.CloseDocument();
+                            PDFViewer.InitDocument(tempPath);
+                            PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+                            if (PDFViewer.Document.WriteToFilePath(currentPath))
+                            {
+                                PDFViewer.CloseDocument();
+                                PDFViewer.InitDocument(currentPath);
+                                if (!string.IsNullOrEmpty(openPassword))
+                                {
+                                    PDFViewer.Document.UnlockWithPassword(openPassword);
+                                }
+
+                                if (!string.IsNullOrEmpty(permissionsPassword))
+                                {
+                                    PDFViewer.Document.CheckOwnerPassword(permissionsPassword);
+                                }
+                                try
+                                {
+                                    PDFViewer.Load();
+                                }
+                                catch
+                                {
+                                }
+                                PDFViewer.UndoManager.CanSave = false;
+                                SecurityInfo.IsPasswordChanged = false;
+                            }
+                            else
+                            {
+                                return false;
+                            }
+                            System.IO.File.Delete(tempPath);
                         }
-                        else if (!string.IsNullOrEmpty(openPassword))
+                        else
                         {
-                            PDFViewer.Document.UnlockWithPassword(openPassword);
+                            return false;
                         }
-                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
 
-                        PDFViewer.Document.WriteToFilePath(currentPath);
-                        PDFViewer.CloseDocument();
-                        PDFViewer.InitDocument(currentPath);
-                        System.IO.File.Delete(tempPath);
-
-                        if (!string.IsNullOrEmpty(permissionsPassword))
-                        {
-                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
-                        }
-                        else if (!string.IsNullOrEmpty(openPassword))
-                        {
-                            PDFViewer.Document.UnlockWithPassword(openPassword);
-                        }
-                        try
-                        {
-                            PDFViewer.Load();
-                        }
-                        catch
-                        {
-                        }
-                        PDFViewer.UndoManager.CanSave = false;
-                        SecurityInfo.IsPasswordChanged = false;
                         return true;
                     }
                     catch
@@ -2123,6 +2128,10 @@ namespace PDF_Office.ViewModels
                 return result;
             }
             catch { return false; }
+            finally
+            {
+                ShowLeftTip(false);
+            }
         }
 
         /// <summary>
@@ -2148,6 +2157,7 @@ namespace PDF_Office.ViewModels
                 }
                 else
                 {
+
                     result = PDFViewer.Document.WriteToFilePath(dlg.FileName);
                     if (result)
                     {

+ 1 - 0
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -81,6 +81,7 @@
                             Padding="5"
                             Background="Transparent"
                             FontSize="14"
+                            TextWrapping="Wrap"
                             Text="{Binding Title}"
                             Visibility="Visible" />
                     </Grid>

+ 333 - 333
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -21,372 +21,372 @@ using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 
 namespace PDF_Office.Views.BOTA
 {
-/// <summary>
+    /// <summary>
     /// BookmarkContent.xaml 的交互逻辑
-/// </summary>
-public partial class BookmarkContent : UserControl
-{
-private BookmarkContentViewModel viewModel = null;
+    /// </summary>
+    public partial class BookmarkContent : UserControl
+    {
+        private BookmarkContentViewModel viewModel = null;
 
-/// <summary>
-    /// 上一个ListBoxItem,为选中状态做准备
-/// </summary>
-private ListBoxItem histotyListBoxItem = null;
+        /// <summary>
+        /// 上一个ListBoxItem,为选中状态做准备
+        /// </summary>
+        private ListBoxItem histotyListBoxItem = null;
 
-private bool isAdd = false;
+        private bool isAdd = false;
 
-public BookmarkContent()
-{
-InitializeComponent();
-viewModel = this.DataContext as BookmarkContentViewModel;
-KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
-KeyEventsHelper.KeyDown += ShortCut_KeyDown;
-}
+        public BookmarkContent()
+        {
+            InitializeComponent();
+            viewModel = this.DataContext as BookmarkContentViewModel;
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+            KeyEventsHelper.KeyDown += ShortCut_KeyDown;
+        }
 
-private void ShortCut_KeyDown(object sender, KeyEventArgs e)
-{
-if (KeyEventsHelper.IsSingleKey(Key.Escape))
-{
-if (BookMarkListView.SelectedItems == null)
-{
-return;
-}
+        private void ShortCut_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (KeyEventsHelper.IsSingleKey(Key.Escape))
+            {
+                if (BookMarkListView.SelectedItems == null)
+                {
+                    return;
+                }
 
-BookMarkListView.SelectedItems.Clear();
-}
-}
+                BookMarkListView.SelectedItems.Clear();
+            }
+        }
 
-/// <summary>
-    ///ListViewItem,鼠标左键点击
-/// </summary>
-/// <param name="sender"></param>
-/// <param name="e"></param>
-private void ListViewItem_MouseButtonDown(object sender, MouseButtonEventArgs e)
-{
-object[] objects = new object[] { sender, e };
-TextBlock textBlock = null;
-ListViewItem listBoxItem = (sender as ListViewItem);
-if (e.LeftButton == MouseButtonState.Pressed)
-{
-if (e.ClickCount >= 2)
-    {
-    histotyListBoxItem = listBoxItem;
-    if (e.OriginalSource is TextBlock)
-    {
-    textBlock = (TextBlock)e.OriginalSource;
+        /// <summary>
+        ///ListViewItem,鼠标左键点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ListViewItem_MouseButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            object[] objects = new object[] { sender, e };
+            TextBlock textBlock = null;
+            ListViewItem listBoxItem = (sender as ListViewItem);
+            if (e.LeftButton == MouseButtonState.Pressed)
+            {
+                if (e.ClickCount >= 2)
+                {
+                    histotyListBoxItem = listBoxItem;
+                    if (e.OriginalSource is TextBlock)
+                    {
+                        textBlock = (TextBlock)e.OriginalSource;
 
-    if (textBlock != null)
-    {
-    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                        if (textBlock != null)
+                        {
+                            TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
 
-        SetSelectedStatus(listBoxItem, textBox, textBlock);
-        }
-        }
-        }
-        else if (e.ClickCount == 1)
-        {
-        if (histotyListBoxItem != listBoxItem)
-        {
-        if (histotyListBoxItem != null)
-        {
-        histotyListBoxItem.IsSelected = false;
-        textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-            textBlock.Visibility = Visibility.Visible;
-            textBlock.Focusable = true;
-            }
-            }
+                            SetSelectedStatus(listBoxItem, textBox, textBlock);
+                        }
+                    }
+                }
+                else if (e.ClickCount == 1)
+                {
+                    if (histotyListBoxItem != listBoxItem)
+                    {
+                        if (histotyListBoxItem != null)
+                        {
+                            histotyListBoxItem.IsSelected = false;
+                            textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                            textBlock.Visibility = Visibility.Visible;
+                            textBlock.Focusable = true;
+                        }
+                    }
 
-            viewModel.ListViewItemMouseDownCommand.Execute(sender);
-            }
+                    viewModel.ListViewItemMouseDownCommand.Execute(sender);
+                }
             }
             else if (e.RightButton == MouseButtonState.Pressed)
             {
-            ContextMenu contextMenu = listBoxItem.ContextMenu;
-            if (contextMenu.Items.Count == 3)
-            {
-            MenuItem rename = contextMenu.Items[0] as MenuItem;
-            MenuItem editPageIndex = contextMenu.Items[1] as MenuItem;
-            MenuItem del = contextMenu.Items[2] as MenuItem;
-            if (isSelects)
-            {
-            rename.IsEnabled = false;
-            editPageIndex.IsEnabled = false;
-            isSelects = false;
+                ContextMenu contextMenu = listBoxItem.ContextMenu;
+                if (contextMenu.Items.Count == 3)
+                {
+                    MenuItem rename = contextMenu.Items[0] as MenuItem;
+                    MenuItem editPageIndex = contextMenu.Items[1] as MenuItem;
+                    MenuItem del = contextMenu.Items[2] as MenuItem;
+                    if (isSelects)
+                    {
+                        rename.IsEnabled = false;
+                        editPageIndex.IsEnabled = false;
+                        isSelects = false;
+                    }
+                    else
+                    {
+                        CPDFBookmark bookmark = (CPDFBookmark)listBoxItem.DataContext;
+                        if (viewModel.PDFViewer.CurrentIndex == bookmark.PageIndex)
+                        {
+                            editPageIndex.IsEnabled = false;
+                            return;
+                        }
+                        rename.IsEnabled = true;
+                        editPageIndex.IsEnabled = true;
+                        editPageIndex.CommandParameter = listBoxItem.DataContext;
+                        editPageIndex.Command = viewModel.EditPageIndexCommand;
+                    }
+                }
             }
-            else
-            {
-            CPDFBookmark bookmark = (CPDFBookmark)listBoxItem.DataContext;
-            if (viewModel.PDFViewer.CurrentIndex == bookmark.PageIndex)
+        }
+
+        private bool isSelects = false;
+
+        private void BookMarkListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var a1 = (sender as ListView).SelectedItems.Count;
+            if (a1 > 1)
             {
-            editPageIndex.IsEnabled = false;
-            return;
-            }
-            rename.IsEnabled = true;
-            editPageIndex.IsEnabled = true;
-            editPageIndex.CommandParameter = listBoxItem.DataContext;
-            editPageIndex.Command = viewModel.EditPageIndexCommand;
-            }
-            }
-            }
+                isSelects = true;
             }
+        }
 
-            private bool isSelects = false;
+        /// <summary>
+        /// ListViewItem双击时选中状态
+        /// </summary>
+        /// <param name="listBoxItem"></param>
+        /// <param name="textBox"></param>
+        /// <param name="textBlock"></param>
+        private void SetSelectedStatus(ListBoxItem listBoxItem, TextBox textBox, TextBlock textBlock)
+        {
+            listBoxItem.IsSelected = true;
+            listBoxItem.Focus();
+            textBlock.Visibility = Visibility.Collapsed;
 
-            private void BookMarkListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+            textBox.Dispatcher.BeginInvoke(new Action(() =>
+                                {
+                                    textBox.Focus();
+                                    textBox.SelectAll();
+                                    //listBoxItem.IsSelected = true;
+                                }));
+        }
+
+        /// <summary>
+        /// ListViewItem失去焦点
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ListViewItem_LostFocus(object sender, RoutedEventArgs e)
+        {
+            ListViewItem listItem = sender as ListViewItem;
+            if (listItem != null)
             {
-            var a1 = (sender as ListView).SelectedItems.Count;
-if (a1 > 1)
-                {
-                isSelects = true;
-                }
-                }
+                BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                viewModel.LostFocusCommand.Execute(listItem);
 
-                /// <summary>
-                    /// ListViewItem双击时选中状态
-                /// </summary>
-                /// <param name="listBoxItem"></param>
-                /// <param name="textBox"></param>
-                /// <param name="textBlock"></param>
-                private void SetSelectedStatus(ListBoxItem listBoxItem, TextBox textBox, TextBlock textBlock)
-                {
-                listBoxItem.IsSelected = true;
-                listBoxItem.Focus();
-                textBlock.Visibility = Visibility.Collapsed;
+                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listItem);
+                TextBox text = CommonHelper.FindVisualChild<TextBox>(listItem);
 
-textBox.Dispatcher.BeginInvoke(new Action(() =>
+                if (textBlock.Visibility != Visibility.Visible)
+                {
+                    if (isAdd == false && isRename == false)
                     {
-                    textBox.Focus();
-                    textBox.SelectAll();
-                    //listBoxItem.IsSelected = true;
-                    }));
+                        listItem.IsSelected = false;
                     }
-
-                    /// <summary>
-                        /// ListViewItem失去焦点
-                    /// </summary>
-                    /// <param name="sender"></param>
-                    /// <param name="e"></param>
-                    private void ListViewItem_LostFocus(object sender, RoutedEventArgs e)
+                    else
                     {
-                    ListViewItem listItem = sender as ListViewItem;
-                    if (listItem != null)
+                        listItem.IsSelected = true;
+                        isAdd = false;
+                    }
+                    if (text.IsSelectionActive == true)
                     {
-                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                    viewModel.LostFocusCommand.Execute(listItem);
-
-                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listItem);
-                        TextBox text = CommonHelper.FindVisualChild<TextBox>(listItem);
-
-                            if (textBlock.Visibility != Visibility.Visible)
-                            {
-                            if (isAdd == false && isRename == false)
-                            {
-                            listItem.IsSelected = false;
-                            }
-                            else
-                            {
-                            listItem.IsSelected = true;
-                            isAdd = false;
-                            }
-                            if (text.IsSelectionActive == true)
-                            {
-                            textBlock.Visibility = Visibility.Visible;
-                            }
-                            }
-                            else
-                            {
-                            listItem.IsSelected = true;
-                            }
+                        textBlock.Visibility = Visibility.Visible;
+                    }
+                }
+                else
+                {
+                    listItem.IsSelected = true;
+                }
 
-                            //if (histotyListBoxItem != null)
-                            //{
-                            //    histotyListBoxItem.IsSelected = false;
-                            //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                                //    textBlock.Visibility = Visibility.Visible;
-                                //    textBlock.Focusable = true;
-                                //}
-                                //if (textBlock.Visibility == Visibility.Collapsed)
-                                //{
-                                //    listItem.IsSelected = false;
-                                //    //textBlock.Visibility = Visibility.Visible;
-                                //}
-                                //else
-                                //{
-                                //    listItem.IsSelected = true;
-                                //    //textBlock.Visibility = Visibility.Collapsed;
-                                //}
-                                }
-                                }
+                //if (histotyListBoxItem != null)
+                //{
+                //    histotyListBoxItem.IsSelected = false;
+                //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                //    textBlock.Visibility = Visibility.Visible;
+                //    textBlock.Focusable = true;
+                //}
+                //if (textBlock.Visibility == Visibility.Collapsed)
+                //{
+                //    listItem.IsSelected = false;
+                //    //textBlock.Visibility = Visibility.Visible;
+                //}
+                //else
+                //{
+                //    listItem.IsSelected = true;
+                //    //textBlock.Visibility = Visibility.Collapsed;
+                //}
+            }
+        }
 
-                                private bool isRename = false;
+        private bool isRename = false;
 
-                                /// <summary>
-                                    /// 右键菜单-重命名
-                                /// </summary>
-                                /// <param name="sender"></param>
-                                /// <param name="e"></param>
-                                private void MenuItemRename_Click(object sender, RoutedEventArgs e)
-                                {
-                                if (sender is MenuItem)
-                                {
-                                MenuItem menuItem = (MenuItem)sender;
-                                CPDFBookmark bookmark = menuItem.CommandParameter as CPDFBookmark;
-                                if (bookmark != null)
-                                {
-                                BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                                isRename = true;
-                                ListViewItem listBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(bookmark));
-                                histotyListBoxItem = listBoxItem;
+        /// <summary>
+        /// 右键菜单-重命名
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemRename_Click(object sender, RoutedEventArgs e)
+        {
+            if (sender is MenuItem)
+            {
+                MenuItem menuItem = (MenuItem)sender;
+                CPDFBookmark bookmark = menuItem.CommandParameter as CPDFBookmark;
+                if (bookmark != null)
+                {
+                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                    isRename = true;
+                    ListViewItem listBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(bookmark));
+                    histotyListBoxItem = listBoxItem;
 
-                                TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
-                                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
-                                        SetSelectedStatus(listBoxItem, textBox, textBlock);
-                                        }
-                                        }
-                                        }
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                    SetSelectedStatus(listBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                        /// <summary>
-                                            /// BookMarkListView,鼠标点击
-                                        /// </summary>
-                                        /// <param name="sender"></param>
-                                        /// <param name="e"></param>
-                                        private void BookMarkListView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
-                                        {
-                                        if (e.LeftButton == MouseButtonState.Pressed)
-                                        {
-                                        var pos = e.GetPosition(BookMarkListView);
+        /// <summary>
+        /// BookMarkListView,鼠标点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BookMarkListView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed)
+            {
+                var pos = e.GetPosition(BookMarkListView);
 
-                                        var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
-                                        if (result != null)
-                                        {
-                                        //获取当前鼠标指针下的容器
-                                        var listBoxItem = CommonHelper.FindVisualParent<ListViewItem>(result.VisualHit);
-                                            if (listBoxItem == null)
-                                            {
-                                            if (BookMarkListView.SelectedItem != null)
-                                            {
-                                            ListViewItem item = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
-                                            item.IsSelected = false;
-                                            TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
-                                                box.Visibility = Visibility.Visible;
-                                                BookMarkListView.SelectedItems.Clear();
-                                                }
-                                                if (histotyListBoxItem != null)
-                                                {
-                                                var pos1 = e.GetPosition(histotyListBoxItem);
-                                                var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
-                                                if (result1 == null)
-                                                {
-                                                histotyListBoxItem.IsSelected = false;
-                                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                                                    textBlock.Visibility = Visibility.Visible;
-                                                    textBlock.Focusable = true;
-                                                    }
-                                                    }
-                                                    }
-                                                    else
-                                                    {
-                                                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
-                                                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
-                                                            if (textBox.IsFocused == false)
-                                                            {
-                                                            listBoxItem.Focus();
-                                                            }
-                                                            }
-                                                            }
-                                                            //BookMarkListView.Focus();
-                                                            }
-                                                            }
+                var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
+                if (result != null)
+                {
+                    //获取当前鼠标指针下的容器
+                    var listBoxItem = CommonHelper.FindVisualParent<ListViewItem>(result.VisualHit);
+                    if (listBoxItem == null)
+                    {
+                        if (BookMarkListView.SelectedItem != null)
+                        {
+                            ListViewItem item = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
+                            item.IsSelected = false;
+                            TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
+                            box.Visibility = Visibility.Visible;
+                            BookMarkListView.SelectedItems.Clear();
+                        }
+                        if (histotyListBoxItem != null)
+                        {
+                            var pos1 = e.GetPosition(histotyListBoxItem);
+                            var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
+                            if (result1 == null)
+                            {
+                                histotyListBoxItem.IsSelected = false;
+                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                                textBlock.Visibility = Visibility.Visible;
+                                textBlock.Focusable = true;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                        if (textBox.IsFocused == false)
+                        {
+                            listBoxItem.Focus();
+                        }
+                    }
+                }
+                //BookMarkListView.Focus();
+            }
+        }
 
-                                                            /// <summary>
-                                                                /// 右键菜单-删除
-                                                            /// </summary>
-                                                            /// <param name="sender"></param>
-                                                            /// <param name="e"></param>
-                                                            private void MenuItemDeleteCommand_Click(object sender, RoutedEventArgs e)
-                                                            {
-                                                            List<int> pagelist = new List<int>();
-                                                                    for (int i = 0; i < BookMarkListView.SelectedItems.Count; i++)
-                                                                      {
-                                                                      CPDFBookmark item = BookMarkListView.SelectedItems[i] as CPDFBookmark;
-                                                                      pagelist.Add(BookMarkListView.Items.IndexOf(item));
-                                                                      }
-                                                                      pagelist.Sort();
-                                                                    for (int i = 0; i < pagelist.Count; i++)
-                                                                      {
-                                                                      CPDFBookmark data = BookMarkListView.Items[pagelist[pagelist.Count - i - 1]] as CPDFBookmark;
-                                                                      if (data != null)
-                                                                      {
-                                                                      viewModel.DeleteCommand.Execute(data);
-                                                                      }
-                                                                      }
-                                                                      }
+        /// <summary>
+        /// 右键菜单-删除
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemDeleteCommand_Click(object sender, RoutedEventArgs e)
+        {
+            List<int> pagelist = new List<int>();
+            for (int i = 0; i < BookMarkListView.SelectedItems.Count; i++)
+            {
+                CPDFBookmark item = BookMarkListView.SelectedItems[i] as CPDFBookmark;
+                pagelist.Add(BookMarkListView.Items.IndexOf(item));
+            }
+            pagelist.Sort();
+            for (int i = 0; i < pagelist.Count; i++)
+            {
+                CPDFBookmark data = BookMarkListView.Items[pagelist[pagelist.Count - i - 1]] as CPDFBookmark;
+                if (data != null)
+                {
+                    viewModel.DeleteCommand.Execute(data);
+                }
+            }
+        }
 
-                                                                      public void BtnAddBookmark_Click(object sender, RoutedEventArgs e)
-                                                                      {
-                                                                      isAdd = true;
-                                                                      viewModel.AddBookmarkCommand.Execute(BookMarkListView);
-                                                                      if (viewModel.IsHasBookmark == false)
-                                                                      {
-                                                                      BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                      ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
-                                                                      if (myListBoxItem == null)
-                                                                      {
-                                                                      BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                                                                      BookMarkListView.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
-                                                                      }
-                                                                      else
-                                                                      {
-                                                                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                                                                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+        public void BtnAddBookmark_Click(object sender, RoutedEventArgs e)
+        {
+            isAdd = true;
+            viewModel.AddBookmarkCommand.Execute(BookMarkListView);
+            if (viewModel.IsHasBookmark == false)
+            {
+                BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
+                if (myListBoxItem == null)
+                {
+                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                    BookMarkListView.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
+                }
+                else
+                {
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
 
-                                                                            SetSelectedStatus(myListBoxItem, textBox, textBlock);
-                                                                            }
-                                                                            }
-                                                                            }
+                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                                                            private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
-                                                                            {
-                                                                            ItemContainerGenerator itemContainer = sender as ItemContainerGenerator;
-                                                                            if (itemContainer.Status == GeneratorStatus.ContainersGenerated)
-                                                                            {
-                                                                            BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                            ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
-                                                                            if (myListBoxItem != null)
-                                                                            {
-                                                                            if (myListBoxItem.RenderSize.Width < 0 && myListBoxItem.RenderSize.Height < 0)
-                                                                              {
-                                                                              BookMarkListView.UpdateLayout();
-                                                                              myListBoxItem.UpdateLayout();
-                                                                              BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                              }
-                                                                            TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                                                                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
-                                                                                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
-                                                                                    }
-                                                                                    }
-                                                                                    }
+        private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
+        {
+            ItemContainerGenerator itemContainer = sender as ItemContainerGenerator;
+            if (itemContainer.Status == GeneratorStatus.ContainersGenerated)
+            {
+                BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
+                if (myListBoxItem != null)
+                {
+                    if (myListBoxItem.RenderSize.Width < 0 && myListBoxItem.RenderSize.Height < 0)
+                    {
+                        BookMarkListView.UpdateLayout();
+                        myListBoxItem.UpdateLayout();
+                        BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                    }
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                                                                    private void BookMarkListView_KeyDown(object sender, KeyEventArgs e)
-                                                                                    {
-                                                                                    if (BookMarkListView.SelectedItems == null)
-                                                                                    {
-                                                                                    return;
-                                                                                    }
-                                                                                    if (e.Key == Key.Escape)
-                                                                                    {
-                                                                                    BookMarkListView.SelectedItems.Clear();
-                                                                                    }
-                                                                                    //if (e.Key == Key.Delete)
-                                                                                    //{
-                                                                              //    if (BookMarkListView.SelectedItems.Count > 0)
-                                                                                        //    {
-                                                                                        //        //全选删除
-                                                                                        //        if (BookMarkListView.SelectedItems.Count == BookMarkListView.Items.Count)
-                                                                                        //        {
-                                                                                        //        }
-                                                                                        //    }
-                                                                                        //}
-                                                                                        }
-                                                                                        }
-                                                                                        }
+        private void BookMarkListView_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (BookMarkListView.SelectedItems == null)
+            {
+                return;
+            }
+            if (e.Key == Key.Escape)
+            {
+                BookMarkListView.SelectedItems.Clear();
+            }
+            //if (e.Key == Key.Delete)
+            //{
+            //    if (BookMarkListView.SelectedItems.Count > 0)
+            //    {
+            //        //全选删除
+            //        if (BookMarkListView.SelectedItems.Count == BookMarkListView.Items.Count)
+            //        {
+            //        }
+            //    }
+            //}
+        }
+    }
+}

+ 24 - 23
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

@@ -55,29 +55,30 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
 
         private void btnRotateRight_Click(object sender, RoutedEventArgs e)
         {
-            if (Window.GetWindow(this) is MainWindow window)
-            {
-                if (window.TabablzControl.SelectedItem is MainContent main)
-                {
-                    if (main.ContentMain.Content is ViewContent viewContent)
-                    {
-                        foreach (var item in viewContent.GridViewer.Children)
-                        {
-                            if (item is ContentControl control)
-                            {
-                                if (control.Content is SplitScreenContent splitScreenContent)
-                                {
-                                    if (splitScreenContent.PDFViewerContent.Content != null)
-                                    {
-                                        viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
+            //分屏视图,同步旋转
+            //if (Window.GetWindow(this) is MainWindow window)
+            //{
+            //    if (window.TabablzControl.SelectedItem is MainContent main)
+            //    {
+            //        if (main.ContentMain.Content is ViewContent viewContent)
+            //        {
+            //            foreach (var item in viewContent.GridViewer.Children)
+            //            {
+            //                if (item is ContentControl control)
+            //                {
+            //                    if (control.Content is SplitScreenContent splitScreenContent)
+            //                    {
+            //                        if (splitScreenContent.PDFViewerContent.Content != null)
+            //                        {
+            //                            viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
+            //                            break;
+            //                        }
+            //                    }
+            //                }
+            //            }
+            //        }
+            //    }
+            //}
             viewModel.RotateCommand.Execute((sender as Button).Tag.ToString());
         }
     }