Tuple是返回多个参数,C# 4.0引入
最多支持8个参数,第八个参数是Tuple,意思就是参数多于8个就开始嵌套调用了
一个函数返回多个类型,这样就不在用out , ref等输出输入参数了,可以直接定义一个tuple类型就可以了。非常方便。
//
// 摘要:
// Creates a new 2-tuple, or pair.
//
// 参数:
// item1:
// The value of the first component of the tuple.
//
// item2:
// The value of the second component of the tuple.
//
// 类型参数:
// T1:
// The type of the first component of the tuple.
//
// T2:
// The type of the second component of the tuple.
//
// 返回结果:
// A 2-tuple whose value is (item1, item2).
public static Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2);
private readonly Tuple<int, int>[] _updateLoopRetryDelays = new [] {
Tuple.Create(0, 3), // 0ms x 3
Tuple.Create(10, 3), // 10ms x 3
Tuple.Create(50, 2), // 50ms x 2
Tuple.Create(100, 2), // 100ms x 2
Tuple.Create(200, 2), // 200ms x 2
Tuple.Create(1000, 2), // 1000ms x 2
Tuple.Create(1500, 2), // 1500ms x 2
Tuple.Create(3000, 1) // 3000ms x 1
};