Cadenza : Cadenza Namespace

Tuple Class

Utility methods to create Tuple instances.

public static class Tuple

Remarks

Provides a set of Tuple.Create methods so that C# type inferencing can easily be used with tuples. For example, instead of:

C# Example
            Tuple<int, long> a = new Tuple<int, long> (1, 2L);

You can instead write:

C# Example
            Tuple<int, long> b = Tuple.Create (1, 2L);
            // or
            var              c = Tuple.Create (1, 2L);

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

Members

See Also: Inherited members from object.

Public Properties

[read-only]
static
MaxValues int . The maximum number of Tuple types provided.

Public Methods

Member Details

Create<T> Generic Method

Creates a Cadenza.Tuple<T>.

public static Tuple<T> Create<T> (T item1)

See Also

Tuple<T>(`0)

Type Parameters

T
The first Cadenza.Tuple<T> value type.

Parameters

item1
The first Cadenza.Tuple<T> value.

Returns

A Cadenza.Tuple<T> initialized with the parameter values.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

Create<T1,T2> Generic Method

Creates a Cadenza.Tuple<T1, T2>.

public static Tuple<T1, T2> Create<T1, T2> (T1 item1, T2 item2)

See Also

Tuple<T1, T2>(`0, `1)

Type Parameters

T1
The first Cadenza.Tuple<T1, T2> value type.
T2
The second Cadenza.Tuple<T1, T2> value type.

Parameters

item1
The first Cadenza.Tuple<T1, T2> value.
item2
The second Cadenza.Tuple<T1, T2> value.

Returns

A Cadenza.Tuple<T1, T2> initialized with the parameter values.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

Create<T1,T2,T3> Generic Method

Creates a Cadenza.Tuple<T1, T2, T3>.

public static Tuple<T1, T2, T3> Create<T1, T2, T3> (T1 item1, T2 item2, T3 item3)

See Also

Tuple<T1, T2, T3>(`0, `1, `2)

Type Parameters

T1
The first Cadenza.Tuple<T1, T2, T3> value type.
T2
The second Cadenza.Tuple<T1, T2, T3> value type.
T3
The third Cadenza.Tuple<T1, T2, T3> value type.

Parameters

item1
The first Cadenza.Tuple<T1, T2, T3> value.
item2
The second Cadenza.Tuple<T1, T2, T3> value.
item3
The third Cadenza.Tuple<T1, T2, T3> value.

Returns

A Cadenza.Tuple<T1, T2, T3> initialized with the parameter values.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

Create<T1,T2,T3,T4> Generic Method

Creates a Cadenza.Tuple<T1, T2, T3, T4>.

public static Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4> (T1 item1, T2 item2, T3 item3, T4 item4)

See Also

Tuple<T1, T2, T3, T4>(`0, `1, `2, `3)

Type Parameters

T1
The first Cadenza.Tuple<T1, T2, T3, T4> value type.
T2
The second Cadenza.Tuple<T1, T2, T3, T4> value type.
T3
The third Cadenza.Tuple<T1, T2, T3, T4> value type.
T4
The fourth Cadenza.Tuple<T1, T2, T3, T4> value type.

Parameters

item1
The first Cadenza.Tuple<T1, T2, T3, T4> value.
item2
The second Cadenza.Tuple<T1, T2, T3, T4> value.
item3
The third Cadenza.Tuple<T1, T2, T3, T4> value.
item4
The fourth Cadenza.Tuple<T1, T2, T3, T4> value.

Returns

A Cadenza.Tuple<T1, T2, T3, T4> initialized with the parameter values.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

MaxValues Property

The maximum number of Tuple types provided.

public static int MaxValues { get; }

Value

The maximum number of Tuple types provided.

Remarks

Only tuples up to a certain "arity" are supported; for example, a Tuple<T1, T2, ..., T100> isn't supported (and won't likely ever be).

Tuple.MaxValues is the maximum number of values that the Tuple types support. If you need to support more values, then you need to either live with potential boxing and use a e.g. List<object> or nest Tuple instantiations, e.g. Tuple<int, Tuple<int, Tuple<int, Tuple<int, int>>>>. The problem with such nesting is that it becomes "unnatural" to access later elements -- t._2._2._2._2 to access the fifth value for the previous example.

Requirements

Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0