示例#1
0
 private void Initialize()
 {
     server          = new Server();
     cook            = new Cook();
     tableRequests   = new TableRequests();
     server.Ready   += (TableRequests tableRequests) => cook.Process(tableRequests);
     cook.Processed += server.Serve;
 }
示例#2
0
        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);
        }