public static void Interactive() { try { IsInteractive = true; AddMenu(Assembly.GetEntryAssembly(), "Main", 'm', new ConsoleMenuDelegate(ShowMenu)); AddMenu(Assembly.GetEntryAssembly(), "Test", 't', new ConsoleMenuDelegate(UnitTestMenu)); ShowMenu(Assembly.GetEntryAssembly(), OtherMenus.ToArray(), "Main"); } catch (Exception ex) { if (ex is ReflectionTypeLoadException typeLoadEx) { ex = new ReflectionTypeLoadAggregateException(typeLoadEx); } OutLine(ex.Message); OutLine(ex.StackTrace); throw; } }
protected static void MainMenu(string header) { AddMenu(Assembly.GetEntryAssembly(), header, 'm', new ConsoleMenuDelegate(ShowMenu)); ShowMenu(Assembly.GetEntryAssembly(), OtherMenus.ToArray(), header); }
protected static void AddMenu(ConsoleMenu menu) { OtherMenus.Add(menu); }
protected static void StartMainMenu() { AddMenu(Assembly.GetCallingAssembly(), "Main Menu", 'm', new ConsoleMenuDelegate(ShowMenu), "Select an option below:"); ShowMenu(Assembly.GetCallingAssembly(), OtherMenus.ToArray(), "Select an option below:"); }