153
/// <param name="binder">Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the <see cref="T:System.Dynamic.DynamicObject" /> class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive.</param>
1
using System;
2
using System.Collections.Generic;
3
using System.Dynamic;
4
using System.Linq;
5
6
public class Program
7
{
8
public static void Main()
9
{
10
dynamic t = new NamedTuple(new[] { "one", "two", "three" });
11
t.Make(new object[] { 3, 2, 1 });
12
13
Console.WriteLine(t.one);
14
}
15
}
16
17
/// <summary>
18
/// A .Net equivalent to Python's namedtuple (http://docs.python.org/dev/library/collections.html#collections.namedtuple)
19
/// </summary>
20
/// <example>
21
/// dynamic t = new NamedTuple(new[] { "one", "two", "three" });
22
/// t.Make(new object[] { 3, 2, 1 });
23
///
24
/// Assert.AreEqual(3, t.one);
Cached Result
Init thread count: 7 (0)
Wrapped
While running thread count: 14 (5)
T6 0
T4 0
T8 0
T7 0
T6 1
T6 done
T8 1
T8 done
T7 1
T7 done
T4 1
T4 done
Done thread count: 14 (5)
Wrapped
While running thread count: 14 (5)
T6 0
T4 0
T8 0
T7 0
T6 1
T6 done
T8 1
T8 done
T7 1
T7 done
T4 1
T4 done
Done thread count: 14 (5)