Пример #1
0
 public void Stop()
 {
     if (!cancelTokenSource.IsCancellationRequested)
     {
         cancelTokenSource.Cancel();
         uiHelper.AddListBoxItem("BankSimulator.Simulate Ended...");
     }
 }
Пример #2
0
        private void InitBank()
        {
            bankVault = new BankVault(bankVaultAmount);

            for (int i = 0; i < numberTellers; i++)
            {
                uiHelper.AddListBoxItem(string.Format(" +Bank.InitBank adding teller {0}", i));
                tellers.Add(new Teller(uiHelper, cancelToken, this));
            }

            for (int i = 0; i < numberCustomers; i++)
            {
                Random rand = new Random();
                uiHelper.AddListBoxItem(string.Format(" +Bank.InitBank adding customer {0}", i));

                custList.SetCustomer(new Customer("customer " + i.ToString(), customersInitAmount));
            }
        }