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

            return
                ((
                     Mentioned == other.Mentioned ||
                     Mentioned != null &&
                     Mentioned.Equals(other.Mentioned)
                     ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ));
        }
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 (Mentioned != null)
         {
             hashCode = hashCode * 59 + Mentioned.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(Ascending.GetHashCode() ^ (Labels != null ? Labels.GetHashCode() : 0) ^ Open.GetHashCode() ^ Since.GetHashCode() ^ SortType.GetHashCode() ^ (Mentioned != null ? Mentioned.GetHashCode() : 0) ^ (Creator != null ? Creator.GetHashCode() : 0) ^ (Assignee != null ? Assignee.GetHashCode() : 0) ^ (Milestone != null ? Milestone.GetHashCode() : 0));
     }
 }