1public bool Equals(T other)
2{
3 if (this.GetType() != other.GetType()) return false;
4 if (ReferenceEquals(null, other)) return false;
5 if (ReferenceEquals(this, other)) return true;
6
7 return this.CompareTo(other) == 0;
8}
9
10public override bool Equals(object obj)
11{
12 if (obj is T)
13 return this.Equals(obj as T);
14 else
15 return base.Equals(obj);
16}