Context: .NET 3.5, VS2008. I\'m not sure about the title of this question, so feel free to comment about the title, too :-)
Here\'s the scenario: I have several cla
It's not as clean an interface as the reflection based solution, but a very simple and flexible solution is to create a ForAll method like so:
static void ForAll(this IEnumerable items, Action action)
{
foreach (T item in items)
{
action(item);
}
}
And can be called like so:
arr.ForAll(x => x.Start());