Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

PairT1, T2

Represents an immutable generic pair of values with multiple functional interfaces 表示具有多个功能接口的不可变泛型值对

Definition

命名空间: DeploySharp.Data
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
[SerializableAttribute]
public class Pair<T1, T2> : IEquatable<Pair<T1, T2>>, 
	IComparable<Pair<T1, T2>>, IEnumerable<Object>, IEnumerable
Inheritance
Object    PairT1, T2
Derived
Implements
IEnumerableObject, IEnumerable, IComparablePairT1, T2, IEquatablePairT1, T2

类型参数

T1
The type of the first element/第一个元素的类型
T2
The type of the second element/第二个元素的类型

备注

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 确定指定的值对是否等于当前值对
FinalizeAllows 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 返回遍历值对元素的枚举器
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
MemberwiseCloneCreates 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 确定两个值对是否不相等

参见