private void Initialize() { server = new Server(); cook = new Cook(); tableRequests = new TableRequests(); server.Ready += (TableRequests tableRequests) => cook.Process(tableRequests); cook.Processed += server.Serve; }
public void RunTask(Cook cook) { Task prepare = new Task(() => cook.Process(tableRequests)); Task <List <string> > prepareServe = prepare.ContinueWith(server.Serve); prepare.Start(); prepareServe.Wait(); qualityLabel.Content = Egg.GetQuality(); Serve(prepareServe.Result); }