using System; public sealed class Tuple { public Tuple(T1 item1, T2 item2, T3 item3) { this.item1 = item1; this.item2 = item2; this.item3 = item3; } public T1 Item1 { get { return this.item1; } } public T2 Item2 { get { return this.item2; } } public T3 Item3 { get { return this.item3; } } public override int GetHashCode() { int num = 17; int num2 = num * 23; int num3; if (this.item1 == null) { num3 = 0; } else { T1 t = this.item1; num3 = t.GetHashCode(); } num = num2 + num3; int num4 = num * 23; int num5; if (this.item2 == null) { num5 = 0; } else { T2 t2 = this.item2; num5 = t2.GetHashCode(); } num = num4 + num5; int num6 = num * 23; int num7; if (this.item3 == null) { num7 = 0; } else { T3 t3 = this.item3; num7 = t3.GetHashCode(); } return num6 + num7; } public override bool Equals(object o) { if (!(o is Tuple)) { return false; } Tuple b = (Tuple)o; return this == b; } public static bool operator ==(Tuple a, Tuple b) { if (object.ReferenceEquals(a, null)) { return object.ReferenceEquals(b, null); } if (a.item1 == null && b.item1 != null) { return false; } if (a.item2 == null && b.item2 != null) { return false; } if (a.item3 == null && b.item3 != null) { return false; } T1 t = a.item1; if (t.Equals(b.item1)) { T2 t2 = a.item2; if (t2.Equals(b.item2)) { T3 t3 = a.item3; return t3.Equals(b.item3); } } return false; } public static bool operator !=(Tuple a, Tuple b) { return !(a == b); } public void Unpack(Action unpackerDelegate) { unpackerDelegate(this.Item1, this.Item2, this.Item3); } private readonly T1 item1; private readonly T2 item2; private readonly T3 item3; }