編輯

共用方式為


HashCode.Combine Method

Definition

Overloads

Combine<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Combines eight values into a hash code.

Combine<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Combines seven values into a hash code.

Combine<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Combines six values into a hash code.

Combine<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Combines five values into a hash code.

Combine<T1,T2,T3,T4>(T1, T2, T3, T4)

Combines four values into a hash code.

Combine<T1,T2,T3>(T1, T2, T3)

Combines three values into a hash code.

Combine<T1,T2>(T1, T2)

Combines two values into a hash code.

Combine<T1>(T1)

Diffuses the hash code returned by the specified value.

Combine<T1,T2,T3,T4,T5,T6,T7,T8>(T1, T2, T3, T4, T5, T6, T7, T8)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines eight values into a hash code.

public:
generic <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
 static int Combine(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8);
public static int Combine<T1,T2,T3,T4,T5,T6,T7,T8> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8);
static member Combine : 'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 * 'T7 * 'T8 -> int
Public Shared Function Combine(Of T1, T2, T3, T4, T5, T6, T7, T8) (value1 As T1, value2 As T2, value3 As T3, value4 As T4, value5 As T5, value6 As T6, value7 As T7, value8 As T8) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

T7

The type of the seventh value to combine into the hash code.

T8

The type of the eighth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

value7
T7

The seventh value to combine into the hash code.

value8
T8

The eighth value to combine into the hash code.

Returns

The hash code that represents the eight values.

Applies to

Combine<T1,T2,T3,T4,T5,T6,T7>(T1, T2, T3, T4, T5, T6, T7)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines seven values into a hash code.

public:
generic <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
 static int Combine(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7);
public static int Combine<T1,T2,T3,T4,T5,T6,T7> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7);
static member Combine : 'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 * 'T7 -> int
Public Shared Function Combine(Of T1, T2, T3, T4, T5, T6, T7) (value1 As T1, value2 As T2, value3 As T3, value4 As T4, value5 As T5, value6 As T6, value7 As T7) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

T7

The type of the seventh value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

value7
T7

The seventh value to combine into the hash code.

Returns

The hash code that represents the seven values.

Applies to

Combine<T1,T2,T3,T4,T5,T6>(T1, T2, T3, T4, T5, T6)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines six values into a hash code.

public:
generic <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
 static int Combine(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6);
public static int Combine<T1,T2,T3,T4,T5,T6> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6);
static member Combine : 'T1 * 'T2 * 'T3 * 'T4 * 'T5 * 'T6 -> int
Public Shared Function Combine(Of T1, T2, T3, T4, T5, T6) (value1 As T1, value2 As T2, value3 As T3, value4 As T4, value5 As T5, value6 As T6) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

T6

The type of the sixth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

value6
T6

The sixth value to combine into the hash code.

Returns

The hash code that represents the six values.

Applies to

Combine<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines five values into a hash code.

public:
generic <typename T1, typename T2, typename T3, typename T4, typename T5>
 static int Combine(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5);
public static int Combine<T1,T2,T3,T4,T5> (T1 value1, T2 value2, T3 value3, T4 value4, T5 value5);
static member Combine : 'T1 * 'T2 * 'T3 * 'T4 * 'T5 -> int
Public Shared Function Combine(Of T1, T2, T3, T4, T5) (value1 As T1, value2 As T2, value3 As T3, value4 As T4, value5 As T5) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

T5

The type of the fifth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

value5
T5

The fifth value to combine into the hash code.

Returns

The hash code that represents the five values.

Applies to

Combine<T1,T2,T3,T4>(T1, T2, T3, T4)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines four values into a hash code.

public:
generic <typename T1, typename T2, typename T3, typename T4>
 static int Combine(T1 value1, T2 value2, T3 value3, T4 value4);
public static int Combine<T1,T2,T3,T4> (T1 value1, T2 value2, T3 value3, T4 value4);
static member Combine : 'T1 * 'T2 * 'T3 * 'T4 -> int
Public Shared Function Combine(Of T1, T2, T3, T4) (value1 As T1, value2 As T2, value3 As T3, value4 As T4) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

T4

The type of the fourth value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

value4
T4

The fourth value to combine into the hash code.

Returns

The hash code that represents the four values.

Applies to

Combine<T1,T2,T3>(T1, T2, T3)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines three values into a hash code.

public:
generic <typename T1, typename T2, typename T3>
 static int Combine(T1 value1, T2 value2, T3 value3);
public static int Combine<T1,T2,T3> (T1 value1, T2 value2, T3 value3);
static member Combine : 'T1 * 'T2 * 'T3 -> int
Public Shared Function Combine(Of T1, T2, T3) (value1 As T1, value2 As T2, value3 As T3) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

T3

The type of the third value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

value3
T3

The third value to combine into the hash code.

Returns

The hash code that represents the three values.

Applies to

Combine<T1,T2>(T1, T2)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Combines two values into a hash code.

public:
generic <typename T1, typename T2>
 static int Combine(T1 value1, T2 value2);
public static int Combine<T1,T2> (T1 value1, T2 value2);
static member Combine : 'T1 * 'T2 -> int
Public Shared Function Combine(Of T1, T2) (value1 As T1, value2 As T2) As Integer

Type Parameters

T1

The type of the first value to combine into the hash code.

T2

The type of the second value to combine into the hash code.

Parameters

value1
T1

The first value to combine into the hash code.

value2
T2

The second value to combine into the hash code.

Returns

The hash code that represents the two values.

Applies to

Combine<T1>(T1)

Source:
HashCode.cs
Source:
HashCode.cs
Source:
HashCode.cs

Diffuses the hash code returned by the specified value.

public:
generic <typename T1>
 static int Combine(T1 value1);
public static int Combine<T1> (T1 value1);
static member Combine : 'T1 -> int
Public Shared Function Combine(Of T1) (value1 As T1) As Integer

Type Parameters

T1

The type of the value to add the hash code.

Parameters

value1
T1

The value to add to the hash code.

Returns

The hash code that represents the single value.

Remarks

Some data structures assume that hash codes are diffused across a large range. This method improves the quality of the hash code returned by the value and is useful when the underlying data type is simple, for example, an integer value.

Applies to