public async Task TaskOrderIsReady(Order order) { // Якобы готовим) await Task.Delay(new Random().Next(2000, 5000)); OnOrderIsReady.Invoke(this, order); }
public void StartCooking() { foreach (Order order in OrdersList) { foreach (KeyValuePair <int, int> keyValue in order.PizzaIdCount) { CookPizza(PizzasList[keyValue.Key], keyValue.Value); } OnOrderIsReady?.Invoke(order); } }