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

            return
                ((
                     Body == other.Body ||
                     Body != null &&
                     Body.Equals(other.Body)
                     ) &&
                 (
                     HortonFlags == other.HortonFlags ||
                     HortonFlags != null &&
                     HortonFlags.Equals(other.HortonFlags)
                 ) &&
                 (
                     Attributes == other.Attributes ||
                     Attributes != null &&
                     Attributes.Equals(other.Attributes)
                 ));
        }
Exemplo n.º 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 (Body != null)
         {
             hashCode = hashCode * 59 + Body.GetHashCode();
         }
         if (HortonFlags != null)
         {
             hashCode = hashCode * 59 + HortonFlags.GetHashCode();
         }
         if (Attributes != null)
         {
             hashCode = hashCode * 59 + Attributes.GetHashCode();
         }
         return(hashCode);
     }
 }