using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Command { internal class User { private List _commands = new List(); public void AddCommand(ICommand command) { _commands.Add(command); } public void AddCommand(StockBroker broker, string symbol, TxType txType, int qty) { ICommand command = new StockCommand(broker, symbol, txType, qty); _commands.Add(command); } public void ExecuteAll() { foreach (ICommand cmd in _commands) { cmd.Execute(); } } } }