/// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (FileId != null)
         {
             hashCode = hashCode * 59 + FileId.GetHashCode();
         }
         if (OwnerPassword != null)
         {
             hashCode = hashCode * 59 + OwnerPassword.GetHashCode();
         }
         if (UserPassword != null)
         {
             hashCode = hashCode * 59 + UserPassword.GetHashCode();
         }
         hashCode = hashCode * 59 + Encryption.GetHashCode();
         hashCode = hashCode * 59 + CanPrint.GetHashCode();
         hashCode = hashCode * 59 + CanCopy.GetHashCode();
         hashCode = hashCode * 59 + CanModify.GetHashCode();
         hashCode = hashCode * 59 + CanAddNotes.GetHashCode();
         hashCode = hashCode * 59 + CanFillFields.GetHashCode();
         hashCode = hashCode * 59 + CanCopyAccess.GetHashCode();
         hashCode = hashCode * 59 + CanAssemble.GetHashCode();
         hashCode = hashCode * 59 + CanPrintFull.GetHashCode();
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if PdfProtectParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of PdfProtectParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PdfProtectParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FileId == input.FileId ||
                     (FileId != null &&
                      FileId.Equals(input.FileId))
                     ) &&
                 (
                     OwnerPassword == input.OwnerPassword ||
                     (OwnerPassword != null &&
                      OwnerPassword.Equals(input.OwnerPassword))
                 ) &&
                 (
                     UserPassword == input.UserPassword ||
                     (UserPassword != null &&
                      UserPassword.Equals(input.UserPassword))
                 ) &&
                 (
                     Encryption == input.Encryption ||
                     Encryption.Equals(input.Encryption)
                 ) &&
                 (
                     CanPrint == input.CanPrint ||
                     CanPrint.Equals(input.CanPrint)
                 ) &&
                 (
                     CanCopy == input.CanCopy ||
                     CanCopy.Equals(input.CanCopy)
                 ) &&
                 (
                     CanModify == input.CanModify ||
                     CanModify.Equals(input.CanModify)
                 ) &&
                 (
                     CanAddNotes == input.CanAddNotes ||
                     CanAddNotes.Equals(input.CanAddNotes)
                 ) &&
                 (
                     CanFillFields == input.CanFillFields ||
                     CanFillFields.Equals(input.CanFillFields)
                 ) &&
                 (
                     CanCopyAccess == input.CanCopyAccess ||
                     CanCopyAccess.Equals(input.CanCopyAccess)
                 ) &&
                 (
                     CanAssemble == input.CanAssemble ||
                     CanAssemble.Equals(input.CanAssemble)
                 ) &&
                 (
                     CanPrintFull == input.CanPrintFull ||
                     CanPrintFull.Equals(input.CanPrintFull)
                 ));
        }
예제 #3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("AllowPrinting=" + AllowPrinting.ToString());
            sb.AppendLine("AllowScreenReader=" + AllowScreenReader.ToString());
            sb.AppendLine("AllowToCopyContent=" + AllowToCopyContent.ToString());
            sb.AppendLine("AllowToEditAssembly=" + AllowToEditAssembly.ToString());
            sb.AppendLine("AllowToEditComments=" + AllowToEditComments.ToString());
            sb.AppendLine("AllowToEditTheDocument=" + AllowToEditTheDocument.ToString());
            sb.AppendLine("AllowToFillForms=" + AllowToFillForms.ToString());
            sb.AppendLine("Enabled=" + Enabled.ToString());
            sb.AppendLine("EncryptionLevel=" + EncryptionLevel.ToString());
            sb.AppendLine("OwnerPassword="******"RequireUserPassword="******"RestrictPrintingToLowQuality=" + RestrictPrintingToLowQuality.ToString());
            sb.AppendLine("UserPassword=" + UserPassword.ToString());

            return(sb.ToString());
        }
예제 #4
0
        public override bool Equals(object o)
        {
            if (!(o is Security))
            {
                return(false);
            }
            Security v = o as Security;

            if (!AllowPrinting.Equals(v.AllowPrinting))
            {
                return(false);
            }
            if (!AllowScreenReader.Equals(v.AllowScreenReader))
            {
                return(false);
            }
            if (!AllowToCopyContent.Equals(v.AllowToCopyContent))
            {
                return(false);
            }
            if (!AllowToEditAssembly.Equals(v.AllowToEditAssembly))
            {
                return(false);
            }
            if (!AllowToEditComments.Equals(v.AllowToEditComments))
            {
                return(false);
            }
            if (!AllowToEditTheDocument.Equals(v.AllowToEditTheDocument))
            {
                return(false);
            }
            if (!AllowToFillForms.Equals(v.AllowToFillForms))
            {
                return(false);
            }
            if (!Enabled.Equals(v.Enabled))
            {
                return(false);
            }
            if (!EncryptionLevel.Equals(v.EncryptionLevel))
            {
                return(false);
            }
            if (!OwnerPassword.Equals(v.OwnerPassword))
            {
                return(false);
            }
            if (!RequireUserPassword.Equals(v.RequireUserPassword))
            {
                return(false);
            }
            if (!RestrictPrintingToLowQuality.Equals(v.RestrictPrintingToLowQuality))
            {
                return(false);
            }
            if (!UserPassword.Equals(v.UserPassword))
            {
                return(false);
            }
            return(true);
        }