|
@@ -362,13 +362,47 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
//选中和非选中注释
|
|
|
private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
|
|
|
{
|
|
|
+ if (e == null)
|
|
|
+ {
|
|
|
+ if (viewContentViewModel.CurrentBar != "TabItemAnnotation")
|
|
|
+ {
|
|
|
+ //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrWhiteSpace(StrAnnotToolChecked))
|
|
|
+ {
|
|
|
+ PropertyPanel.annot = null;
|
|
|
+ PropertyPanel.AnnotEvents = null;
|
|
|
+ PropertyPanel.AnnotEvent = null;
|
|
|
+ PropertyPanel.annotlists = null;
|
|
|
+ if (StrAnnotToolChecked != "Stamp" && StrAnnotToolChecked != "Freetext")
|
|
|
+ {
|
|
|
+ AnnotHandlerEventArgs annotArgs = null;
|
|
|
+ //propertyPanel.SaveLastAnnot();
|
|
|
+ FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PropertyPanel.annot = null;
|
|
|
+ PropertyPanel.AnnotEvents = null;
|
|
|
+ PropertyPanel.AnnotEvent = null;
|
|
|
+ PropertyPanel.annotlists = null;
|
|
|
+ viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (e != null)
|
|
|
- {
|
|
|
- if (e.IsMouseRightActive)
|
|
|
- {
|
|
|
- ShowPropertyPanel(false);
|
|
|
- return;
|
|
|
- }
|
|
|
+ {
|
|
|
+ if (e.IsMouseRightActive)
|
|
|
+ {
|
|
|
+ ShowPropertyPanel(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
CurrentSelectedAnnot = null;
|
|
|
var annot = e.AnnotItemsList[0];
|
|
|
if (annot != null)
|
|
@@ -525,58 +559,23 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- if (viewContentViewModel.CurrentBar != "TabItemAnnotation")
|
|
|
- {
|
|
|
- //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (!string.IsNullOrWhiteSpace(StrAnnotToolChecked))
|
|
|
- {
|
|
|
- PropertyPanel.annot = null;
|
|
|
- PropertyPanel.AnnotEvents = null;
|
|
|
- PropertyPanel.AnnotEvent = null;
|
|
|
- PropertyPanel.annotlists = null;
|
|
|
- if (StrAnnotToolChecked != "Stamp" && StrAnnotToolChecked != "Freetext")
|
|
|
- {
|
|
|
- AnnotHandlerEventArgs annotArgs = null;
|
|
|
- //propertyPanel.SaveLastAnnot();
|
|
|
- FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
|
|
|
- //if (annotArgs != null)
|
|
|
- //{
|
|
|
- // //设置点击页面会创建对应选中注释工具的注释
|
|
|
- // annotArgs.Author = Settings.Default.AppProperties.Description.Author;
|
|
|
- // PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
- // PDFViewer.SetToolParam(annotArgs);
|
|
|
- //}
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PropertyPanel.annot = null;
|
|
|
- PropertyPanel.AnnotEvents = null;
|
|
|
- PropertyPanel.AnnotEvent = null;
|
|
|
- PropertyPanel.annotlists = null;
|
|
|
- viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
- }
|
|
|
-
|
|
|
- //if (StrAnnotToolChecked == "Link")
|
|
|
- //{
|
|
|
- // if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
|
|
|
- // {
|
|
|
- // if (PDFViewer.MouseMode == MouseModes.PanTool && propertyPanel.IsAddLink == false && propertyPanel.IsLocationLink == false)
|
|
|
- // {
|
|
|
- // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //if (string.IsNullOrWhiteSpace(StrAnnotToolChecked))
|
|
|
- //{
|
|
|
- // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
- //}
|
|
|
- }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ //if (StrAnnotToolChecked == "Link")
|
|
|
+ //{
|
|
|
+ // if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
|
|
|
+ // {
|
|
|
+ // if (PDFViewer.MouseMode == MouseModes.PanTool && propertyPanel.IsAddLink == false && propertyPanel.IsLocationLink == false)
|
|
|
+ // {
|
|
|
+ // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //if (string.IsNullOrWhiteSpace(StrAnnotToolChecked))
|
|
|
+ //{
|
|
|
+ // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
+ //}
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
//在注释工具的状态下,右键菜单
|
|
@@ -926,6 +925,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
|
|
|
private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
|
|
|
{
|
|
|
+ bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
|
|
|
+
|
|
|
if (e != null && e.Count > 0)
|
|
|
{
|
|
|
MultipleSelectionAnnot(e);
|
|
@@ -937,7 +938,11 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
switch (editEvent.EditAction)
|
|
|
{
|
|
|
case ActionType.Add:
|
|
|
-
|
|
|
+ //if (viewContentViewModel.OpenBOTA == false || isTabItemAnnotation == false || bOTAContent.TabItemAnnotation.IsSelected == false)
|
|
|
+ //{
|
|
|
+ // viewContentViewModel.OpenBOTA = true;
|
|
|
+ // bOTAContent.TabItemAnnotation.IsSelected = true;
|
|
|
+ //}
|
|
|
//if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
|
|
|
//{
|
|
|
// PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
|
|
@@ -947,9 +952,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
// PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
|
|
|
//}
|
|
|
//BOTA
|
|
|
- bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
|
|
|
|
|
|
- if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
|
|
|
+ if (viewContentViewModel.OpenBOTA == true && bOTAContent.TabItemAnnotation.IsSelected)
|
|
|
{
|
|
|
AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
|
|
|
|
|
@@ -975,8 +979,8 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
break;
|
|
|
|
|
|
case ActionType.Del:
|
|
|
- isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
|
|
|
- if (isTabItemAnnotation)
|
|
|
+ //isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
|
|
|
+ if (bOTAContent.TabItemAnnotation.IsSelected)
|
|
|
{
|
|
|
AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
|
|
|
|
|
@@ -990,7 +994,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
break;
|
|
|
|
|
|
case ActionType.Modify:
|
|
|
- isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
|
|
|
+ //isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
|
|
|
if (bOTAContent.TabItemAnnotation.IsSelected)
|
|
|
{
|
|
|
AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
|
|
@@ -1049,7 +1053,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isAdd && selectAnnotDicts.Count > 1)
|
|
|
+ if (isAdd && selectAnnotDicts.Count >= 1)
|
|
|
{
|
|
|
PDFViewer.ClearSelectAnnots();
|
|
|
|