public void Stop() { if (!cancelTokenSource.IsCancellationRequested) { cancelTokenSource.Cancel(); uiHelper.AddListBoxItem("BankSimulator.Simulate Ended..."); } }
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)); } }