Show / Hide Table of Contents

Class Tuple<T1, T2>

Tuple class with 2 items

Inheritance
object
Tuple<T1, T2>
Pair<TKey, TValue>
Implements
IEquatable<Tuple<T1, T2>>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
Namespace: Lokad
Assembly: Algenta.Colectica.Model.dll
Syntax
[Serializable]
public class Tuple<T1, T2> : IEquatable<Tuple<T1, T2>>
Type Parameters
Name Description
T1

The type of the first item.

T2

The type of the second item.

Constructors

Tuple(T1, T2)

Initializes a new instance of the Pair<TKey, TValue> class.

Declaration
public Tuple(T1 first, T2 second)
Parameters
Type Name Description
T1 first

The first item.

T2 second

The second item.

Properties

Item1

Gets Item1.

Declaration
public T1 Item1 { get; }
Property Value
Type Description
T1

The item1.

Item2

Gets Item2.

Declaration
public T2 Item2 { get; }
Property Value
Type Description
T2

The item2.

Methods

Equals(Tuple<T1, T2>)

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(Tuple<T1, T2> obj)
Parameters
Type Name Description
Tuple<T1, T2> obj

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the obj parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current Pair<TKey, TValue>.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current Pair<TKey, TValue>.

Returns
Type Description
bool

true if the specified object is equal to the current Pair<TKey, TValue>; otherwise, false.

Overrides
object.Equals(object)
Exceptions
Type Condition
NullReferenceException

The obj parameter is null.

GetHashCode()

Serves as a hash function for a particular type.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()

ToString()

Returns a string that represents the current Pair<TKey, TValue>.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current Pair<TKey, TValue>.

Overrides
object.ToString()

Operators

operator ==(Tuple<T1, T2>, Tuple<T1, T2>)

Implements the operator ==.

Declaration
public static bool operator ==(Tuple<T1, T2> left, Tuple<T1, T2> right)
Parameters
Type Name Description
Tuple<T1, T2> left

The left.

Tuple<T1, T2> right

The right.

Returns
Type Description
bool

The result of the operator.

operator !=(Tuple<T1, T2>, Tuple<T1, T2>)

Implements the operator !=.

Declaration
public static bool operator !=(Tuple<T1, T2> left, Tuple<T1, T2> right)
Parameters
Type Name Description
Tuple<T1, T2> left

The left.

Tuple<T1, T2> right

The right.

Returns
Type Description
bool

The result of the operator.

Implements

IEquatable<T>

Extension Methods

Extensions.Yield<T>(T)
TupleExtensions.Append<T1, T2, T3>(Tuple<T1, T2>, T3)
In this article
Back to top Generated by DocFX