See Also: Tuple<T1,T2,T3,T4,T5,T6,T7> Members
- T1
- Documentation for this section has not yet been entered.
- T2
- Documentation for this section has not yet been entered.
- T3
- Documentation for this section has not yet been entered.
- T4
- Documentation for this section has not yet been entered.
- T5
- Documentation for this section has not yet been entered.
- T6
- Documentation for this section has not yet been entered.
- T7
- Documentation for this section has not yet been entered.
A tuple is a data structure that has a specific number and sequence of values. The Tuple`7 class represents a 7-tuple, or septuple, which is a tuple that has seven components.
You can instantiate a Tuple`7 object by calling either the Tuple`7.#ctor(`0, `1, `2, `3, `4, `5, `6) or the static Tuple.Create``7(``0, ``1, ``2, ``3, ``4, ``5, ``6) method. You can retrieve the value of the tuple's components by using the read-only Tuple`7.Item1, Tuple`7.Item2, Tuple`7.Item3, Tuple`7.Item4, Tuple`7.Item5, Tuple`7.Item6, and Tuple`7.Item7 instance properties.
Tuples are commonly used in four different ways:
To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record.
To provide easy access to, and manipulation of, a data set. The following example defines a Tuple`7 object that contains population data for New York City for each census from 1950 through 2000. The septuple is passed to the ComputePopulationChange method, which calculates the annual rate of change between censuses, as well as the annual rate of change for the entire 60 year period.
code reference: System.Tuple`7.Class#1
To return multiple values from a method without the use of out parameters (in C#) or ByRef parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a Tuple`7 object.
To pass multiple values to a method through a single parameter. For example, the System.Threading.Thread.Start(object) method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a Tuple`7 object as the method argument, you can supply the thread’s startup routine with seven items of data.