Exemple #1
0
 public bool EnqueueCustomer(Customer c)
 {
     if (_opened && !IsFull())
     {
         lock (this)
         {
             _queue.Enqueue(c);
             Program.Debug("Customer #" + c.ID + " -> SP #" + ID);
         }
         _notify();
         return true;
     }
     return false;
 }
Exemple #2
0
 public static bool writeSim(Customer.CustomerStart[] simCustomers, Stream stream)
 {
     try
     {
         StreamWriter f = new StreamWriter(stream);
         foreach (Customer.CustomerStart cs in simCustomers)
         {
             f.WriteLine(cs.items + ";"// + cs.stat + ";"
                 + cs.delay);
         }
         f.Flush();
         return true;
     }
     catch (Exception e)
     {
         lastException = e;
         return false;
     }
 }