Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Generated by Reflector from C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
- namespace System
- {
- using System.Collections;
- using System.Collections.Generic;
- using System.Runtime;
- using System.Text;
- [Serializable, __DynamicallyInvokable]
- public class Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple
- {
- private readonly T1 m_Item1;
- private readonly T2 m_Item2;
- [__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
- public Tuple(T1 item1, T2 item2)
- {
- this.m_Item1 = item1;
- this.m_Item2 = item2;
- }
- [__DynamicallyInvokable]
- public override bool Equals(object obj)
- {
- return ((IStructuralEquatable) this).Equals(obj, EqualityComparer<object>.Default);
- }
- [__DynamicallyInvokable]
- public override int GetHashCode()
- {
- return ((IStructuralEquatable) this).GetHashCode(EqualityComparer<object>.Default);
- }
- [__DynamicallyInvokable]
- int IStructuralComparable.CompareTo(object other, IComparer comparer)
- {
- if (other == null)
- {
- return 1;
- }
- Tuple<T1, T2> tuple = other as Tuple<T1, T2>;
- if (tuple == null)
- {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", new object[] { base.GetType().ToString() }), "other");
- }
- int num = 0;
- num = comparer.Compare(this.m_Item1, tuple.m_Item1);
- if (num != 0)
- {
- return num;
- }
- return comparer.Compare(this.m_Item2, tuple.m_Item2);
- }
- [__DynamicallyInvokable]
- bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
- {
- if (other == null)
- {
- return false;
- }
- Tuple<T1, T2> tuple = other as Tuple<T1, T2>;
- if (tuple == null)
- {
- return false;
- }
- return (comparer.Equals(this.m_Item1, tuple.m_Item1) && comparer.Equals(this.m_Item2, tuple.m_Item2));
- }
- [__DynamicallyInvokable]
- int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
- {
- return Tuple.CombineHashCodes(comparer.GetHashCode(this.m_Item1), comparer.GetHashCode(this.m_Item2));
- }
- [__DynamicallyInvokable]
- int IComparable.CompareTo(object obj)
- {
- return ((IStructuralComparable) this).CompareTo(obj, Comparer<object>.Default);
- }
- int ITuple.GetHashCode(IEqualityComparer comparer)
- {
- return ((IStructuralEquatable) this).GetHashCode(comparer);
- }
- string ITuple.ToString(StringBuilder sb)
- {
- sb.Append(this.m_Item1);
- sb.Append(", ");
- sb.Append(this.m_Item2);
- sb.Append(")");
- return sb.ToString();
- }
- [__DynamicallyInvokable]
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("(");
- return ((ITuple) this).ToString(sb);
- }
- [__DynamicallyInvokable]
- public T1 Item1
- {
- [__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
- get
- {
- return this.m_Item1;
- }
- }
- [__DynamicallyInvokable]
- public T2 Item2
- {
- [__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
- get
- {
- return this.m_Item2;
- }
- }
- int ITuple.Size
- {
- get
- {
- return 2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement