Example #1
0
        /// <summary>
        /// Returns true if OutputCredentialsInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of OutputCredentialsInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OutputCredentialsInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                     ) &&
                 (
                     Key == other.Key ||
                     Key != null &&
                     Key.Equals(other.Key)
                 ) &&
                 (
                     Cert == other.Cert ||
                     Cert != null &&
                     Cert.Equals(other.Cert)
                 ) &&
                 (
                     AuthMode == other.AuthMode ||
                     AuthMode != null &&
                     AuthMode.Equals(other.AuthMode)
                 ) &&
                 (
                     SCAL == other.SCAL ||
                     SCAL != null &&
                     SCAL.Equals(other.SCAL)
                 ) &&
                 (
                     PIN == other.PIN ||
                     PIN != null &&
                     PIN.Equals(other.PIN)
                 ) &&
                 (
                     OTP == other.OTP ||
                     OTP != null &&
                     OTP.Equals(other.OTP)
                 ) &&
                 (
                     Multisign == other.Multisign ||
                     Multisign != null &&
                     Multisign.Equals(other.Multisign)
                 ) &&
                 (
                     Lang == other.Lang ||
                     Lang != null &&
                     Lang.Equals(other.Lang)
                 ));
        }
Example #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Key != null)
         {
             hashCode = hashCode * 59 + Key.GetHashCode();
         }
         if (Cert != null)
         {
             hashCode = hashCode * 59 + Cert.GetHashCode();
         }
         if (AuthMode != null)
         {
             hashCode = hashCode * 59 + AuthMode.GetHashCode();
         }
         if (SCAL != null)
         {
             hashCode = hashCode * 59 + SCAL.GetHashCode();
         }
         if (PIN != null)
         {
             hashCode = hashCode * 59 + PIN.GetHashCode();
         }
         if (OTP != null)
         {
             hashCode = hashCode * 59 + OTP.GetHashCode();
         }
         if (Multisign != null)
         {
             hashCode = hashCode * 59 + Multisign.GetHashCode();
         }
         if (Lang != null)
         {
             hashCode = hashCode * 59 + Lang.GetHashCode();
         }
         return(hashCode);
     }
 }