예제 #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 (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (InputPosition != null)
         {
             hashCode = hashCode * 59 + InputPosition.GetHashCode();
         }
         if (OutputPosition != null)
         {
             hashCode = hashCode * 59 + OutputPosition.GetHashCode();
         }
         if (Zone != null)
         {
             hashCode = hashCode * 59 + Zone.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #2
0
        public override int GetHashCode()
        {
            int result = !string.ReferenceEquals(_code, null) ? _code.GetHashCode() : 0;

            result = 31 * result + (!string.ReferenceEquals(_title, null) ? _title.GetHashCode() : 0);
            result = 31 * result + (!string.ReferenceEquals(_description, null) ? _description.GetHashCode() : 0);
            result = 31 * result + (_severityLevel != null ? _severityLevel.GetHashCode() : 0);
            result = 31 * result + (_position != null ? _position.GetHashCode() : 0);
            return(result);
        }
예제 #3
0
파일: State.cs 프로젝트: Coki32/BNFParser
 public override int GetHashCode() =>
 Production.GetHashCode() + DotPosition.GetHashCode() * 17 + InputPosition.GetHashCode() * 31;