mscorlib 4.0.0.0 System.Object System.Collections.IStructuralComparable System.Collections.IStructuralEquatable System.IComparable System.ITuple To be added. To be added. To be added.

A tuple is a data structure that has a specific number and sequence of values. The class represents a 3-tuple, or triple, which is a tuple that has three components.

You can instantiate a object by calling either the constructor or the static method. You can retrieve the values of the tuple's components by using the read-only , , and 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 an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the ComputeStatistics method, which calculates the mean and standard deviation of the test scores.

code reference: System.Tuple`3.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 summary test score statistics in a object.

To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread’s startup routine with three items of data.

Represents a 3-tuple, or triple.

- Constructor
  4.0.0.0
  To be added.
  To be added.
  To be added.
  To be added.
  To be added.
- Method
  4.0.0.0
  System.Boolean ``

  The parameter is considered to be equal to the current instance under the following conditions:

  It is a object.

  Its three components are of the same types as the current instance.

  Its three components are equal to those of the current instance. Equality is determined by the default object equality comparer for each component.

  Returns a value that indicates whether the current object is equal to a specified object.

  true if the current instance is equal to the specified object; otherwise, false.

  The object to compare with this instance.
- Method
  4.0.0.0
  System.Int32 To be added.

  Returns the hash code for the current object.

  A 32-bit signed integer hash code.

- Property
  4.0.0.0
  T1 To be added.

  You can dynamically determine the type of the component in one of two ways:

  By calling the GetType method on the value that is returned by the property.

  By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method.

  Gets the value of the current object's first component.

- Property
  4.0.0.0
  T2 To be added.

  You can dynamically determine the type of the component in one of two ways:

  By calling the GetType method on the value that is returned by the property.

  By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method.

  Gets the value of the current object's second component.

- Property
  4.0.0.0
  T3 To be added.

  You can dynamically determine the type of the component in one of two ways:

  By calling the GetType method on the value returned by the property.

  By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method.

  Gets the value of the current object's third component.

- Method
  4.0.0.0
  System.Int32 `` ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor.

  The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method.

  Compares the current object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order.

  A signed integer that indicates the relative position of this instance and in the sort order, as shown in the following table.

  Value

  Description

  A negative integer

  This instance precedes .

  Zero

  This instance and have the same position in the sort order.

  A positive integer

  This instance follows .

  An object to compare with the current instance. An object that provides custom rules for comparison.
- Method
  4.0.0.0
  System.Boolean `` ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  The implementation is called only if is not null, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns true, the method is called again and passed the values of the two objects. If this method call returns true again, the method is called a third time and passed the values of the two objects.

  Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method.

  true if the current instance is equal to the specified object; otherwise, false.

  The object to compare with this instance. An object that defines the method to use to evaluate whether the two objects are equal.
- Method
  4.0.0.0
  System.Int32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  The method simply wraps a call to the object's implementation.

  The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal.

  Calculates the hash code for the current object by using a specified computation method.

  A 32-bit signed integer hash code.

  An object whose method calculates the hash code of the current object.
- Method
  4.0.0.0
  System.Int32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection.

  The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method.

  The method uses the default object comparer to compare each component.

  Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order.

  A signed integer that indicates the relative position of this instance and in the sort order, as shown in the following table.

  Value

  Description

  A negative integer

  This instance precedes .

  Zero

  This instance and have the same position in the sort order.

  A positive integer

  This instance follows .

  An object to compare with the current instance.
- Method
  4.0.0.0
  System.String To be added. To be added. To be added.
- Method
  4.0.0.0
  System.String

  The string returned by this method takes the form (Item1, Item2, Item3), where Item1, Item2, and Item3 represent the values of the , , and properties, respectively. If any of the property values is null, it is represented as .

  Returns a string that represents the value of this instance.

  The string representation of this object.