Beispiel #1
0
        public void QueueContentsEnum(DefinedQueue localQueue)
        {
            BankCustomer tempCustomer = new BankCustomer();

            // get the built in enumerator
            System.Collections.IEnumerator en = localQueue.GetEnumerator();
            Console.WriteLine(" ");
            Console.WriteLine("View the queue using an enumerator");
            while (en.MoveNext())
            {
                tempCustomer = (BankCustomer)en.Current;
                Console.WriteLine("Name: " + tempCustomer.name + ",  Activity: " + tempCustomer.bankingActivity + ",  Account no: " + tempCustomer.accountNumber.ToString() + ", Amount $" + tempCustomer.amount.ToString());
            }
        }