using ComPDFKit.PDFDocument; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PDF_Master.Model.Dialog.ToolsDialogs.SaftyDialogs { public class CheckPasswordDialogModel { static public Dictionary InitHavePermissionsInfo(CPDFDocument document) { Dictionary GetHavePermissionsFromPermissionsSet = new Dictionary(); GetHavePermissionsFromPermissionsSet.Clear(); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentChanges, document.GetPermissionsInfo().AllowsDocumentChanges); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsPrinting, document.GetPermissionsInfo().AllowsPrinting); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsHighQualityPrinting, document.GetPermissionsInfo().AllowsHighQualityPrinting); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCopying, document.GetPermissionsInfo().AllowsCopying); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentAssembly, document.GetPermissionsInfo().AllowsDocumentAssembly); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsFormFieldEntry, document.GetPermissionsInfo().AllowsFormFieldEntry); GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCommenting, document.GetPermissionsInfo().AllowsCommenting); return GetHavePermissionsFromPermissionsSet; } } public enum EnumPermissionsSet { None = 0, StatusAllowsDocumentChanges = 1<<1, StatusAllowsPrinting = 1 <<2, StatusAllowsHighQualityPrinting = 1<<3, StatusAllowsCopying = 1<<4, StatusAllowsDocumentAssembly = 1<<5, StatusAllowsFormFieldEntry = 1<<6, StatusAllowsCommenting = 1<<7 } }