|
@@ -613,6 +613,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private string pageNumTextStr = string.Empty;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 页码文本框 Enter键
|
|
|
/// </summary>
|
|
@@ -624,6 +626,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
if (keyEventArgs.Key == Key.Enter)
|
|
|
{
|
|
|
PageNumTextLostFocus(obj);
|
|
|
+ pageNumTextStr = PageNumTextContent;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -644,7 +647,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
/// <param name="obj"></param>
|
|
|
private void PageNumTextLostFocus(object obj)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(PageNumTextContent) && pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
+ if (!string.IsNullOrEmpty(PageNumTextContent)
|
|
|
+ && pdfViewer.MouseMode == MouseModes.AnnotCreate
|
|
|
+ && pageNumTextStr != PageNumTextContent)
|
|
|
{
|
|
|
if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
|
|
|
{
|
|
@@ -675,26 +680,21 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//LinkAnnotArgs.DestIndex = pageNum - 1;
|
|
|
//pdfViewer.CreatePageAnnot(pdfViewer.CurrentIndex, LinkAnnotArgs);
|
|
|
}
|
|
|
- //else
|
|
|
- //{
|
|
|
- if (LinkAnnotArgs.AnnotIndex != -1)
|
|
|
- {
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
|
|
|
- AnnotAttribEvent?.UpdateAnnot();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LinkAnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
- }
|
|
|
- //}
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // //右键选择文本 创建链接
|
|
|
+ // LinkAnnotArgs.DestIndex = pageNum - 1;
|
|
|
+ // LinkAnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
+ //}
|
|
|
+ if (LinkAnnotArgs.AnnotIndex != -1)
|
|
|
+ {
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
|
|
|
+ AnnotAttribEvent?.UpdateAnnot();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //右键选择文本 创建链接
|
|
|
- //viewContentViewModel.IsRightMenuSelectedTextAddLink = false;
|
|
|
- LinkAnnotArgs.DestIndex = pageNum - 1;
|
|
|
- //pdfViewer.CreatePageAnnot(pdfViewer.CurrentIndex, LinkAnnotArgs);
|
|
|
LinkAnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
}
|
|
|
|
|
@@ -826,8 +826,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//}
|
|
|
if (pdfViewer.MouseMode == MouseModes.AnnotCreate)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
historyPageIndex = pdfViewer.CurrentIndex;
|
|
|
|
|
|
isSelected = false;
|
|
@@ -921,25 +919,22 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
viewContentViewModel.IsSelectedTextAddLink = false;
|
|
|
//pdfViewer.CreatePageAnnot(historyPageIndex, LinkAnnotArgs);
|
|
|
}
|
|
|
- //else
|
|
|
- //{
|
|
|
- if (LinkAnnotArgs.AnnotIndex != -1)
|
|
|
- {
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
- AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
|
- AnnotAttribEvent?.UpdateAnnot();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
- }
|
|
|
- //}
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // //右键选择文本 创建链接
|
|
|
+
|
|
|
+ // //pdfViewer.CreatePageAnnot(historyPageIndex, LinkAnnotArgs);
|
|
|
+ // LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
+ //}
|
|
|
+ if (LinkAnnotArgs.AnnotIndex != -1)
|
|
|
+ {
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
+ AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
|
+ AnnotAttribEvent?.UpdateAnnot();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //右键选择文本 创建链接
|
|
|
-
|
|
|
- //pdfViewer.CreatePageAnnot(historyPageIndex, LinkAnnotArgs);
|
|
|
LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
|
|
|
}
|
|
|
|
|
@@ -976,7 +971,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
// pdfViewer.SetToolParam(annotArgs);
|
|
|
// return;
|
|
|
//}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|