static void Main(string[] args) { var myParam = new MyParam { Id = 1, }; var basicCommand = new BasicCommand2(); int i2 = 0; var actions = System.Linq.Enumerable.Range(0, 10).Select(i => new Action(() => basicCommand.SendCommand(new MyParam { Id = i, }))); foreach (Action a in actions) { Console.WriteLine("Starting {0}", i2++); a.Invoke(); } Console.ReadLine(); }
void OnProcessingCommand(BasicCommand2 sender, ResponseCompleteEvent e) { Console.WriteLine("OnProcessingCommand Id:{0}", e.Id); }