[SerializableAttribute]
public class Pair<T1, T2> : IEquatable<Pair<T1, T2>>,
IComparable<Pair<T1, T2>>, IEnumerable<Object>, IEnumerable
Provides implementations for equality comparison, sorting, enumeration and tuple conversion. 提供相等比较、排序、枚举和元组转换的实现。
Supports pattern matching through deconstruction. 通过解构支持模式匹配。
PairT1, T2 | Initializes a new instance of the Pair class 初始化Pair类的新实例 |
PairT1, T2(T1, T2) | Initializes a new instance of the Pair class with specified values 使用指定值初始化Pair类的新实例 |
First | Gets or sets the first element of the pair 获取或设置值对的第一个元素 |
Second | Gets or sets the second element of the pair 获取或设置值对的第二个元素 |
CompareTo | Compares the current pair with another pair 将当前值对与另一个值对进行比较 |
Deconstruct | Deconstructs the pair into individual components 将值对解构为单独组件 |
Equals(Object) |
Determines whether the specified object is equal to the current pair
确定指定的对象是否等于当前值对
(重写 ObjectEquals(Object)) |
Equals(PairT1, T2) | Determines whether the specified pair is equal to the current pair 确定指定的值对是否等于当前值对 |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetEnumerator | Returns an enumerator that iterates through the pair elements 返回遍历值对元素的枚举器 |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
ToString |
Returns a string that represents the current pair
返回表示当前值对的字符串
(重写 ObjectToString) |
Equality(PairT1, T2, PairT1, T2) | Determines whether two pairs are equal 确定两个值对是否相等 |
(PairT1, T2 to ValueTupleT1, T2) | Converts a Pair implicitly to a tuple 隐式将Pair转换为元组 |
(ValueTupleT1, T2 to PairT1, T2) | Converts a tuple implicitly to a Pair 隐式将元组转换为Pair |
Inequality(PairT1, T2, PairT1, T2) | Determines whether two pairs are not equal 确定两个值对是否不相等 |