ITuple ITuple ITuple ITuple Interface

定义

定义通用元组实现,它允许在不知道基础元组类型的情况下访问元组实例。Defines a general-purpose Tuple implementation that allows access to Tuple instance members without knowing the underlying Tuple type.

public interface class ITuple
public interface ITuple
type ITuple = interface
Public Interface ITuple
派生

注解

您使用ITuple接口来访问而无需事先了解数量或类型的元组中的元素的元组实例的单个元素。You use the ITuple interface to access individual elements of a Tuple instance without knowing beforehand the number or types of elements in the Tuple. 检索的值来确定的元组中的项数Length属性。You determine the number of items in the Tuple by retrieving the value of the Length property. 然后可以通过传递的索引,范围在 0 到 1 的值小于枚举及其元素Length属性设置为Item[Int32]属性。You can then enumerate its elements by passing an index that ranges from zero to one less than value of the Length property to the Item[Int32] property.

ITuple 是的显式接口实现Tuple类和ValueTuple结构。ITuple is an explicit interface implementation of the Tuple classes and the ValueTuple structures. 必须强制转换Tuple对象传递给ITuple接口对象之前可以访问其属性。You must cast the Tuple object to an ITuple interface object before you can access its properties.

属性

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

返回指定 Tuple 元素的值。Returns the value of the specified Tuple element.

Length Length Length Length

获取此 Tuple 实例中的元素数。Gets the number of elements in this Tuple instance.

适用于