コード例 #1
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hashCode = Name?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Arguments?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CommandNames?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
コード例 #2
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>
 /// A 32-bit signed integer that is the hash code for this instance.
 /// </returns>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CommandNames != null ? CommandNames.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Arguments != null ? Arguments.GetHashCode() : 0);
         return(hashCode);
     }
 }