예제 #1
0
        /// <summary>Returns a string that represents the value of this <see cref="T:System.ValueTuple`8" /> instance. </summary>
        /// <returns>The string representation of this <see cref="T:System.ValueTuple`8" /> instance. </returns>
        // Token: 0x0600046E RID: 1134 RVA: 0x0000DD90 File Offset: 0x0000BF90
        public override string ToString()
        {
            IValueTupleInternal valueTupleInternal = this.Rest as IValueTupleInternal;
            T1 t;
            T2 t2;
            T3 t3;
            T4 t4;
            T5 t5;
            T6 t6;
            T7 t7;

            if (valueTupleInternal == null)
            {
                string[] array = new string[17];
                array[0] = "(";
                int    num = 1;
                ref T1 ptr = ref this.Item1;
                t = default(T1);
                string text;
                if (t == null)
                {
                    t   = this.Item1;
                    ptr = ref t;
                    if (t == null)
                    {
                        text = null;
                        goto IL_5D;
                    }
                }
                text = ptr.ToString();
IL_5D:
                array[num] = text;
                array[2]   = ", ";
                int    num2 = 3;
                ref T2 ptr2 = ref this.Item2;
예제 #2
0
        // Token: 0x0600046C RID: 1132 RVA: 0x0000DA6C File Offset: 0x0000BC6C
        private int GetHashCodeCore(IEqualityComparer comparer)
        {
            IValueTupleInternal valueTupleInternal = this.Rest as IValueTupleInternal;

            if (valueTupleInternal == null)
            {
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item1), comparer.GetHashCode(this.Item2), comparer.GetHashCode(this.Item3), comparer.GetHashCode(this.Item4), comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7)));
            }
            int length = valueTupleInternal.Length;

            if (length >= 8)
            {
                return(valueTupleInternal.GetHashCode(comparer));
            }
            switch (8 - length)
            {
            case 1:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 2:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 3:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 4:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item4), comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 5:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item3), comparer.GetHashCode(this.Item4), comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 6:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item2), comparer.GetHashCode(this.Item3), comparer.GetHashCode(this.Item4), comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            case 7:
            case 8:
                return(ValueTuple.CombineHashCodes(comparer.GetHashCode(this.Item1), comparer.GetHashCode(this.Item2), comparer.GetHashCode(this.Item3), comparer.GetHashCode(this.Item4), comparer.GetHashCode(this.Item5), comparer.GetHashCode(this.Item6), comparer.GetHashCode(this.Item7), valueTupleInternal.GetHashCode(comparer)));

            default:
                return(-1);
            }
        }
예제 #3
0
        /// <summary>Calculates the hash code for the current <see cref="T:System.ValueTuple`8" /> instance.</summary>
        /// <returns>The hash code for the current <see cref="T:System.ValueTuple`8" /> instance. </returns>
        // Token: 0x0600046A RID: 1130 RVA: 0x0000D774 File Offset: 0x0000B974
        public override int GetHashCode()
        {
            IValueTupleInternal valueTupleInternal = this.Rest as IValueTupleInternal;

            if (valueTupleInternal == null)
            {
                return(ValueTuple.CombineHashCodes(EqualityComparer <T1> .Default.GetHashCode(this.Item1), EqualityComparer <T2> .Default.GetHashCode(this.Item2), EqualityComparer <T3> .Default.GetHashCode(this.Item3), EqualityComparer <T4> .Default.GetHashCode(this.Item4), EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7)));
            }
            int length = valueTupleInternal.Length;

            if (length >= 8)
            {
                return(valueTupleInternal.GetHashCode());
            }
            switch (8 - length)
            {
            case 1:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 2:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 3:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 4:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T4> .Default.GetHashCode(this.Item4), EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 5:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T3> .Default.GetHashCode(this.Item3), EqualityComparer <T4> .Default.GetHashCode(this.Item4), EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 6:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T2> .Default.GetHashCode(this.Item2), EqualityComparer <T3> .Default.GetHashCode(this.Item3), EqualityComparer <T4> .Default.GetHashCode(this.Item4), EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            case 7:
            case 8:
                return(ValueTuple.CombineHashCodes(EqualityComparer <T1> .Default.GetHashCode(this.Item1), EqualityComparer <T2> .Default.GetHashCode(this.Item2), EqualityComparer <T3> .Default.GetHashCode(this.Item3), EqualityComparer <T4> .Default.GetHashCode(this.Item4), EqualityComparer <T5> .Default.GetHashCode(this.Item5), EqualityComparer <T6> .Default.GetHashCode(this.Item6), EqualityComparer <T7> .Default.GetHashCode(this.Item7), valueTupleInternal.GetHashCode()));

            default:
                return(-1);
            }
        }