Adding C# solution.
[IEnumerableExtras.git] / C# / Pair.cs
blobe022de13dd783b6633a1b0356aa13694379f3a72
1 namespace IEnumerableExtras
3 /// <summary>
4 /// Represents a pair of items of type <typeparamref name="TValue"/>.
5 /// </summary>
6 /// <typeparam name="TValue"></typeparam>
7 public class Pair< TValue >
9 private readonly TValue _left;
10 private readonly TValue _right;
12 /// <summary>
13 /// Initialize an instance of <see cref="Pair{TValue}"/> with two
14 /// items of type <typeparamref name="TValue"/>.
15 /// </summary>
16 /// <param name="left"></param>
17 /// <param name="right"></param>
18 public Pair( TValue left, TValue right )
20 _left = left;
21 _right = right;
24 /// <summary>
25 /// Gets first (left) item.
26 /// </summary>
27 public TValue Left
29 get
31 return _left;
35 /// <summary>
36 /// Gets second (right) item.
37 /// </summary>
38 public TValue Right
40 get
42 return _right;