CheckPasswordDialogModel.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using ComPDFKit.PDFDocument;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace PDF_Master.Model.Dialog.ToolsDialogs.SaftyDialogs
  8. {
  9. public class CheckPasswordDialogModel
  10. {
  11. static public Dictionary<EnumPermissionsSet, bool> InitHavePermissionsInfo(CPDFDocument document)
  12. {
  13. Dictionary<EnumPermissionsSet, bool> GetHavePermissionsFromPermissionsSet = new Dictionary<EnumPermissionsSet, bool>();
  14. GetHavePermissionsFromPermissionsSet.Clear();
  15. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentChanges, document.GetPermissionsInfo().AllowsDocumentChanges);
  16. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsPrinting, document.GetPermissionsInfo().AllowsPrinting);
  17. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsHighQualityPrinting, document.GetPermissionsInfo().AllowsHighQualityPrinting);
  18. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCopying, document.GetPermissionsInfo().AllowsCopying);
  19. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentAssembly, document.GetPermissionsInfo().AllowsDocumentAssembly);
  20. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsFormFieldEntry, document.GetPermissionsInfo().AllowsFormFieldEntry);
  21. GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCommenting, document.GetPermissionsInfo().AllowsCommenting);
  22. return GetHavePermissionsFromPermissionsSet;
  23. }
  24. }
  25. public enum EnumPermissionsSet
  26. {
  27. None = 0,
  28. StatusAllowsDocumentChanges = 1<<1,
  29. StatusAllowsPrinting = 1 <<2,
  30. StatusAllowsHighQualityPrinting = 1<<3,
  31. StatusAllowsCopying = 1<<4,
  32. StatusAllowsDocumentAssembly = 1<<5,
  33. StatusAllowsFormFieldEntry = 1<<6,
  34. StatusAllowsCommenting = 1<<7
  35. }
  36. }