|
@@ -4,6 +4,7 @@ using ComPDFKitViewer.PdfViewer;
|
|
using PDF_Office.CustomControl;
|
|
using PDF_Office.CustomControl;
|
|
using PDF_Office.Helper;
|
|
using PDF_Office.Helper;
|
|
using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
|
|
using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
|
|
|
|
+using PDF_Office.ViewModels.Tools.AnnotManager;
|
|
using PDF_Office.Views.PropertyPanel.AnnotPanel;
|
|
using PDF_Office.Views.PropertyPanel.AnnotPanel;
|
|
using PDFSettings.Settings;
|
|
using PDFSettings.Settings;
|
|
using Prism.Commands;
|
|
using Prism.Commands;
|
|
@@ -16,143 +17,6 @@ using System.Windows.Media;
|
|
|
|
|
|
namespace PDF_Office.ViewModels.Tools
|
|
namespace PDF_Office.ViewModels.Tools
|
|
{
|
|
{
|
|
- /// <summary>
|
|
|
|
- /// 改变工具栏注释属性值,主要用来传参数:注释属性和同步工具栏对应图标的属性(颜色)
|
|
|
|
- /// </summary>
|
|
|
|
- public class AnnotPropertyPanel
|
|
|
|
- {
|
|
|
|
- public bool IsAddLink = false;
|
|
|
|
- public bool IsLocationLink = false;
|
|
|
|
- public AnnotAttribEvent AnnotEvent { get; set; }
|
|
|
|
- public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
|
|
|
|
-
|
|
|
|
- public AnnotHandlerEventArgs annot;
|
|
|
|
- public List<AnnotHandlerEventArgs> annotlists;
|
|
|
|
-
|
|
|
|
- public bool IsTextFill { get; private set; }
|
|
|
|
-
|
|
|
|
- public void SetIsTextFill(bool isTextFill)
|
|
|
|
- {
|
|
|
|
- IsTextFill = isTextFill;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
|
|
|
|
-
|
|
|
|
- public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
|
|
|
|
-
|
|
|
|
- public event EventHandler<object> DefaultStored;
|
|
|
|
-
|
|
|
|
- public AnnotPropertyPanel()
|
|
|
|
- { }
|
|
|
|
-
|
|
|
|
- //外部UI控件选中状态
|
|
|
|
- public static bool IsSolidStyle(DashStyle LineDash)
|
|
|
|
- {
|
|
|
|
- bool isSolid = true;
|
|
|
|
- if (LineDash == null || LineDash.Dashes.Count == 0)
|
|
|
|
- {
|
|
|
|
- return isSolid;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- foreach (var item in LineDash.Dashes)
|
|
|
|
- {
|
|
|
|
- if (item > 0)
|
|
|
|
- {
|
|
|
|
- isSolid = false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return isSolid;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static DashStyle GetLineDashStyle(bool isSolid)
|
|
|
|
- {
|
|
|
|
- DashStyle newDash = new DashStyle();
|
|
|
|
- if (isSolid == false)
|
|
|
|
- {
|
|
|
|
- newDash.Dashes.Add(2);
|
|
|
|
- newDash.Dashes.Add(2);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- newDash = DashStyles.Solid;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return newDash;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //单个属性更改
|
|
|
|
- public void UpdateAnnotAAttrib(AnnotAttrib annotAttrib, object obj)
|
|
|
|
- {
|
|
|
|
- if (annotlists != null && annotlists.Count > 1)
|
|
|
|
- {
|
|
|
|
- foreach (var itemevent in AnnotEvents)
|
|
|
|
- {
|
|
|
|
- itemevent?.UpdateAttrib(annotAttrib, obj);
|
|
|
|
- itemevent?.UpdateAnnot();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- AnnotEvent?.UpdateAttrib(annotAttrib, obj);
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //多个属性更改
|
|
|
|
- public void UpdateAnnotAllAttribs(Dictionary<AnnotAttrib, object> AnnotAttribDir)
|
|
|
|
- {
|
|
|
|
- if (annotlists != null && annotlists.Count > 1)
|
|
|
|
- {
|
|
|
|
- foreach (var itemevent in AnnotEvents)
|
|
|
|
- {
|
|
|
|
- foreach (var item in AnnotAttribDir)
|
|
|
|
- {
|
|
|
|
- itemevent?.UpdateAttrib(item.Key, item.Value);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- itemevent?.UpdateAnnot();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- foreach (var item in AnnotAttribDir)
|
|
|
|
- {
|
|
|
|
- AnnotEvent?.UpdateAttrib(item.Key, item.Value);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- AnnotEvent?.UpdateAnnot();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //是否为多选
|
|
|
|
- public bool IsMultiSelected
|
|
|
|
- { get { return (annotlists != null && annotlists.Count > 1); } }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// 更新多个属性,触发到工具栏注释工具,改变工具图标下的颜色值
|
|
|
|
- /// </summary>
|
|
|
|
- public void InvokeToMyTools(object sender, Dictionary<AnnotArgsType, object> keyValues)
|
|
|
|
- {
|
|
|
|
- DataChanged?.Invoke(sender, keyValues);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// 更新单个属性
|
|
|
|
- /// </summary>
|
|
|
|
- public void InvokeToMyTools(AnnotArgsType argsType, object obj)
|
|
|
|
- {
|
|
|
|
- Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
|
|
|
|
- changeData[argsType] = obj;
|
|
|
|
- DataChanged?.Invoke(null, changeData);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //同一属性面板,切换注释工具
|
|
|
|
- public void AnnotTypeChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
|
|
|
|
- {
|
|
|
|
- AnnotTypeChanged?.Invoke(sender, keyValues);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
public sealed partial class AnnotToolContentViewModel
|
|
public sealed partial class AnnotToolContentViewModel
|
|
{
|
|
{
|
|
@@ -276,7 +140,7 @@ namespace PDF_Office.ViewModels.Tools
|
|
public OpenFileInfo OpenFileInfo = null;
|
|
public OpenFileInfo OpenFileInfo = null;
|
|
public CPDFViewer PDFViewer;
|
|
public CPDFViewer PDFViewer;
|
|
private ViewContentViewModel viewContentViewModel;
|
|
private ViewContentViewModel viewContentViewModel;
|
|
- private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
|
|
|
|
|
|
+ private AnnotTransfer propertyPanel = new AnnotTransfer();
|
|
private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
|
|
private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
|
|
private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
|
|
private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
|
|
private List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
|
|
private List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
|