123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- using ComPDFKitViewer;
- using PDF_Master.ViewModels.PageEdit;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace PDF_Master.Model.PageEdit
- {
- public class PageEditHistory:IHistory
- {
- /// <summary>
- /// 操作类型
- /// </summary>
- public ActionType Type { get; set; }
- /// <summary>
- /// 原位置-新位置集合 用于倒序、旋转、拖拽排序
- /// </summary>
- public Dictionary<int, int> SourceTargetValue { get; set; }
- /// <summary>
- /// 插入位置
- /// </summary>
- public int InsertIndex { get; set; }
- /// <summary>
- ///插入文件的文件路径
- /// </summary>
- public string InsertFilePath { get; set; }
- /// <summary>
- /// 插入文件的密码
- /// </summary>
- public string InsertFilePassWord { get; set; }
- /// <summary>
- /// 插入文档的页面总数
- /// </summary>
- public int InsertPageCount { get; set; }
- /// <summary>
- /// 插入的页面尺寸大小
- /// </summary>
- public Size PageSize { get; set; }
- /// <summary>
- /// 为方便处理 暂时直接调用页面编辑部分的undo redo 方法
- /// </summary>
- public PageEditContentViewModel viewmodel { get; set; }
- public bool Redo()
- {
- viewmodel.Redo(this);
- return true;
- }
- public bool Undo()
- {
- viewmodel.Undo(this);
- return true;
- }
- }
- /// <summary>
- /// 操作类型
- /// </summary>
- public enum ActionType
- {
- /// <summary>
- /// 页面右旋转
- /// </summary>
- RightRotate,
- /// <summary>
- /// 页面左旋转
- /// </summary>
- LeftRotate,
- /// <summary>
- /// 从文件插入
- /// </summary>
- InsertFromFile,
- /// <summary>
- /// 插入自定义页面
- /// </summary>
- InsertCustomPages,
- /// <summary>
- /// 拖拽排序
- /// </summary>
- DragSort,
- /// <summary>
- /// 倒序
- /// </summary>
- Reverse,
- /// <summary>
- /// 粘贴
- /// </summary>
- Paste
- }
- }
|