コード例 #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 (Before != null)
         {
             hashCode = hashCode * 59 + Before.GetHashCode();
         }
         if (Now != null)
         {
             hashCode = hashCode * 59 + Now.GetHashCode();
         }
         if (After != null)
         {
             hashCode = hashCode * 59 + After.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AccessToken.Length != 0)
            {
                hash ^= AccessToken.GetHashCode();
            }
            if (Now != 0)
            {
                hash ^= Now.GetHashCode();
            }
            if (ExpiredAt != 0)
            {
                hash ^= ExpiredAt.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }