/// <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 (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Abstract != null) { hashCode = hashCode * 59 + Abstract.GetHashCode(); } if (NpasgrUpperLimit != null) { hashCode = hashCode * 59 + NpasgrUpperLimit.GetHashCode(); } if (NpasgrLowerLimit != null) { hashCode = hashCode * 59 + NpasgrLowerLimit.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { unchecked { var hash = 17; hash = hash * 23 + Matching.GetHashCode(); foreach (var type in types) { if (type != null) { hash = hash * 23 + type.GetHashCode(); } } hash = hash * 23 + Value.GetHashCode(); hash = hash * 23 + Reference.GetHashCode(); hash = hash * 23 + Classes.GetHashCode(); hash = hash * 23 + Interfaces.GetHashCode(); hash = hash * 23 + Structs.GetHashCode(); hash = hash * 23 + Enums.GetHashCode(); hash = hash * 23 + Delegates.GetHashCode(); hash = hash * 23 + Public.GetHashCode(); hash = hash * 23 + NonPublic.GetHashCode(); hash = hash * 23 + Abstract.GetHashCode(); hash = hash * 23 + Generic.GetHashCode(); hash = hash * 23 + OpenConstructedGeneric.GetHashCode(); hash = hash * 23 + Static.GetHashCode(); hash = hash * 23 + Sealed.GetHashCode(); hash = hash * 23 + Nested.GetHashCode(); hash = hash * 23 + Primitives.GetHashCode(); hash = hash * 23 + Object.GetHashCode(); hash = hash * 23 + NonSerializable.GetHashCode(); hash = hash * 23 + Obsolete.GetHashCode(); hash = hash * 23 + GenericParameterAttributeFlags.GetHashCode(); return(hash); } }