// Constructors public ConsoleMenu(AccountTable accounts) { accountTable = accounts; accountTable.OnError += InformUser; add.OnMessage += InformUser; delete.OnMessage += InformUser; select.OnMessage += InformUser; update.OnMessage += InformUser; exit.OnMessage += InformUser; }
private static void Main(string[] args) { AccountTable accounts = null; try { accounts = new AccountTable(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadKey(); return; } Test.AddAccounts(accounts); ConsoleMenu menu = new ConsoleMenu(accounts); menu.Start(); }