public override void Run() { objects = new List<object>(); for(int i=0; i < N; i++) { var obj = new ClassWithEventHandlers(); var firstCallBack = new FirstCallBacks(); var secondCallBack = new SecondCallBacks(); obj.FirstEventHandler += firstCallBack.MyFirstCallBack; obj.SecondEventHandler += secondCallBack.MySecondCallBack; if (i >= M) { objects.Add(firstCallBack); } objects.Add(secondCallBack); objects.Add(obj); } }
public override void Run() { objects = new List <object>(); for (int i = 0; i < N; i++) { var obj = new ClassWithEventHandlers(); var firstCallBack = new FirstCallBacks(); var secondCallBack = new SecondCallBacks(); obj.FirstEventHandler += firstCallBack.MyFirstCallBack; obj.SecondEventHandler += secondCallBack.MySecondCallBack; if (i >= M) { objects.Add(firstCallBack); } objects.Add(secondCallBack); objects.Add(obj); } }