Beispiel #1
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 (AlwaysShow != null)
         {
             hashCode = hashCode * 59 + AlwaysShow.GetHashCode();
         }
         if (DisplayOrder != null)
         {
             hashCode = hashCode * 59 + DisplayOrder.GetHashCode();
         }
         if (FormElement != null)
         {
             hashCode = hashCode * 59 + FormElement.GetHashCode();
         }
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (Link != null)
         {
             hashCode = hashCode * 59 + Link.GetHashCode();
         }
         if (Mask != null)
         {
             hashCode = hashCode * 59 + Mask.GetHashCode();
         }
         if (Obfuscate != null)
         {
             hashCode = hashCode * 59 + Obfuscate.GetHashCode();
         }
         if (PlaceholderLabel != null)
         {
             hashCode = hashCode * 59 + PlaceholderLabel.GetHashCode();
         }
         if (PreferredInputType != null)
         {
             hashCode = hashCode * 59 + PreferredInputType.GetHashCode();
         }
         if (Tooltip != null)
         {
             hashCode = hashCode * 59 + Tooltip.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if PaymentProductFieldDisplayHints instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentProductFieldDisplayHints to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentProductFieldDisplayHints other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AlwaysShow == other.AlwaysShow ||
                     AlwaysShow != null &&
                     AlwaysShow.Equals(other.AlwaysShow)
                     ) &&
                 (
                     DisplayOrder == other.DisplayOrder ||
                     DisplayOrder != null &&
                     DisplayOrder.Equals(other.DisplayOrder)
                 ) &&
                 (
                     FormElement == other.FormElement ||
                     FormElement != null &&
                     FormElement.Equals(other.FormElement)
                 ) &&
                 (
                     Label == other.Label ||
                     Label != null &&
                     Label.Equals(other.Label)
                 ) &&
                 (
                     Link == other.Link ||
                     Link != null &&
                     Link.Equals(other.Link)
                 ) &&
                 (
                     Mask == other.Mask ||
                     Mask != null &&
                     Mask.Equals(other.Mask)
                 ) &&
                 (
                     Obfuscate == other.Obfuscate ||
                     Obfuscate != null &&
                     Obfuscate.Equals(other.Obfuscate)
                 ) &&
                 (
                     PlaceholderLabel == other.PlaceholderLabel ||
                     PlaceholderLabel != null &&
                     PlaceholderLabel.Equals(other.PlaceholderLabel)
                 ) &&
                 (
                     PreferredInputType == other.PreferredInputType ||
                     PreferredInputType != null &&
                     PreferredInputType.Equals(other.PreferredInputType)
                 ) &&
                 (
                     Tooltip == other.Tooltip ||
                     Tooltip != null &&
                     Tooltip.Equals(other.Tooltip)
                 ));
        }