示例#1
0
 /// <summary>
 ///     Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked            // Overflow is fine, just wrap
     {
         int hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Rtr != null)
         {
             hashCode = hashCode * 59 + Rtr.GetHashCode();
         }
         if (Rtd != null)
         {
             hashCode = hashCode * 59 + Rtd.GetHashCode();
         }
         if (Itr != null)
         {
             hashCode = hashCode * 59 + Itr.GetHashCode();
         }
         if (Itd != null)
         {
             hashCode = hashCode * 59 + Itd.GetHashCode();
         }
         if (Catr != null)
         {
             hashCode = hashCode * 59 + Catr.GetHashCode();
         }
         if (Tatr != null)
         {
             hashCode = hashCode * 59 + Tatr.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <summary>
        ///     Returns true if OperationalCapability instances are equal
        /// </summary>
        /// <param name="other">Instance of OperationalCapability to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OperationalCapability other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Rtr == other.Rtr ||
                     Rtr != null &&
                     Rtr.Equals(other.Rtr)
                     ) &&
                 (
                     Rtd == other.Rtd ||
                     Rtd != null &&
                     Rtd.Equals(other.Rtd)
                 ) &&
                 (
                     Itr == other.Itr ||
                     Itr != null &&
                     Itr.Equals(other.Itr)
                 ) &&
                 (
                     Itd == other.Itd ||
                     Itd != null &&
                     Itd.Equals(other.Itd)
                 ) &&
                 (
                     Catr == other.Catr ||
                     Catr != null &&
                     Catr.Equals(other.Catr)
                 ) &&
                 (
                     Tatr == other.Tatr ||
                     Tatr != null &&
                     Tatr.Equals(other.Tatr)
                 ));
        }