Example #1
0
 public void GeefBestellingIn(BestelEventArgs args)
 {
     /*
      * if (_bestellingEvent != null)
      *  _bestellingEvent(this, args);
      */
     BestellingEvent?.Invoke(this, args);
 }
Example #2
0
 public void BestellingOntvangen(object sender, BestelEventArgs args)
 {
     if (args == null || string.IsNullOrEmpty(args.Product))
     {
         return;                                                     // preconditie
     }
     System.Console.WriteLine(args.Product + " in voorbereiding");
     System.Threading.Thread.Sleep(5000);
     Bel.Ring(args);
 }
Example #3
0
        private void BelGehoord(object sender, BestelEventArgs args)
        {
            // LINQ:
            var klant = this._klanten.Where(k => k.Naam == args.Klant).FirstOrDefault(); // EERSTE OF NULL

            if (klant == null)
            {
                return;
            }
            klant.Betaal(args.Product);
            klant.Consumeer(args.Product);
        }
Example #4
0
 public void Ring(BestelEventArgs args)
 {
     RingEvent?.Invoke(this, args);
 }