Пример #1
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         foreach (var typeArgument in TypeArguments.Select(x => x.Value))
         {
             hashCode = (hashCode * 397) ^ typeArgument.GetHashCode();
         }
         hashCode ^= OriginalDefinitionSyntax.GetHashCode();
         return(hashCode);
     }
 }
Пример #2
0
 public bool Equals(StructType other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(Name, other.Name) &&
            TypeArguments.Select(x => x.Value).SequenceEqual(other.TypeArguments.Select(x => x.Value)) &&
            OriginalDefinitionSyntax.Equals(other.OriginalDefinitionSyntax));
 }