How do I build an Action action in a loop? to explain (sorry it\'s so lengthy)
I have the following:
public interface ISomeInterface {
void MethodOn
It's really easy, because delegates are already multicast:
Action action1 = z => z.MethodOne();
Action action2 = z => z.MethodTwo("relativeFolderName");
builder.BuildMap(action1 + action2, "IAnotherInterfaceName");
Or if you've got a collection of them for some reason:
IEnumerable> actions = GetActions();
Action action = null;
foreach (Action singleAction in actions)
{
action += singleAction;
}
Or even:
IEnumerable> actions = GetActions();
Action action = (Action)
Delegate.Combine(actions.ToArray());