|
@@ -39,6 +39,7 @@ using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms;
|
|
|
|
+using System.Windows.Input;
|
|
using System.Windows.Markup;
|
|
using System.Windows.Markup;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Media.Imaging;
|
|
@@ -62,7 +63,6 @@ namespace PDF_Office.ViewModels.BOTA
|
|
{
|
|
{
|
|
#region 文案
|
|
#region 文案
|
|
|
|
|
|
-
|
|
|
|
private string T_expand;
|
|
private string T_expand;
|
|
|
|
|
|
public string T_Expand
|
|
public string T_Expand
|
|
@@ -73,7 +73,6 @@ namespace PDF_Office.ViewModels.BOTA
|
|
SetProperty(ref T_expand, value);
|
|
SetProperty(ref T_expand, value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
private string T_collapse;
|
|
private string T_collapse;
|
|
|
|
|
|
@@ -85,7 +84,6 @@ namespace PDF_Office.ViewModels.BOTA
|
|
SetProperty(ref T_collapse, value);
|
|
SetProperty(ref T_collapse, value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
private string T_import;
|
|
private string T_import;
|
|
|
|
|
|
@@ -142,7 +140,6 @@ namespace PDF_Office.ViewModels.BOTA
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
private void InitString()
|
|
private void InitString()
|
|
{
|
|
{
|
|
T_Expand = App.MainPageLoader.GetString("Annotation_MenuExpand");
|
|
T_Expand = App.MainPageLoader.GetString("Annotation_MenuExpand");
|
|
@@ -154,7 +151,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
T_EmptyContext = App.MainPageLoader.GetString("Annotation_EmptyContext");
|
|
T_EmptyContext = App.MainPageLoader.GetString("Annotation_EmptyContext");
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion 文案
|
|
|
|
|
|
private ListBox listBox;
|
|
private ListBox listBox;
|
|
private IRegionManager region;
|
|
private IRegionManager region;
|
|
@@ -364,10 +361,15 @@ namespace PDF_Office.ViewModels.BOTA
|
|
pagelist.Add(item.AnnotIndex);
|
|
pagelist.Add(item.AnnotIndex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- PdfViewer.RemovePageAnnot(deleteLists);
|
|
|
|
- AnnotationListItems.Clear();
|
|
|
|
- CurrentAnnotationLists.Clear();
|
|
|
|
- PdfViewer.UndoManager.CanSave = true;
|
|
|
|
|
|
+ AlertsMessage alertsMessage = new AlertsMessage();
|
|
|
|
+ alertsMessage.ShowDialog(" ", "This action will permanently delete all comments,\r\nWhether to continue??", "Cancel", "OK");
|
|
|
|
+ if (alertsMessage.result == ContentResult.Ok)
|
|
|
|
+ {
|
|
|
|
+ PdfViewer.RemovePageAnnot(deleteLists);
|
|
|
|
+ AnnotationListItems.Clear();
|
|
|
|
+ CurrentAnnotationLists.Clear();
|
|
|
|
+ PdfViewer.UndoManager.CanSave = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -1121,6 +1123,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
|
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
public void OnNavigatedFrom(NavigationContext navigationContext)
|
|
{
|
|
{
|
|
|
|
+ KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
|
|
}
|
|
}
|
|
|
|
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
public void OnNavigatedTo(NavigationContext navigationContext)
|
|
@@ -1132,6 +1135,51 @@ namespace PDF_Office.ViewModels.BOTA
|
|
ViewContentViewModel = viewContentViewModel;
|
|
ViewContentViewModel = viewContentViewModel;
|
|
PdfViewer = pdfview;
|
|
PdfViewer = pdfview;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
|
|
|
|
+ KeyEventsHelper.KeyDown += ShortCut_KeyDown;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void ShortCut_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ if (KeyEventsHelper.IsSingleKey(System.Windows.Input.Key.Escape))
|
|
|
|
+ {
|
|
|
|
+ if (listBox != null)
|
|
|
|
+ {
|
|
|
|
+ if (listBox.SelectedItems == null)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ listBox.SelectedItems.Clear();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (KeyEventsHelper.IsSingleKey(System.Windows.Input.Key.Delete))
|
|
|
|
+ {
|
|
|
|
+ if (listBox != null)
|
|
|
|
+ {
|
|
|
|
+ if (listBox.SelectedItems == null)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ List<int> pagelist = new List<int>();
|
|
|
|
+ for (int i = 0; i < listBox.SelectedItems.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ AnnotationHandlerEventArgs annotation = listBox.SelectedItems[i] as AnnotationHandlerEventArgs;
|
|
|
|
+ pagelist.Add(listBox.Items.IndexOf(annotation));
|
|
|
|
+ }
|
|
|
|
+ pagelist.Sort();
|
|
|
|
+ for (int i = 0; i < pagelist.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ AnnotationHandlerEventArgs annotation = listBox.Items[pagelist[pagelist.Count - i - 1]] as AnnotationHandlerEventArgs;
|
|
|
|
+ if (annotation == null)
|
|
|
|
+ {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DeleteCommand.Execute(annotation);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|