private static void MenuLoop() { Clear(); _currentContext.Show(); string selection = Prompt(" select option"); MightQuit(selection); if (selection.ToLowerInvariant().Equals("b")) { if (_currentContext == _mainContext) { Clear(); SelectClass(); } else { _currentContext = _currentContext.LastMenu; } } else { object result = _currentContext.Menu.RunSelection(selection); if (result != null) { MenuContext next = MenuContextType.Construct <MenuContext>(result, _writer); next.LastMenu = _currentContext; _currentContext = next; } } MenuLoop(); }
protected static void MenuLoop(Type selectedType) { SetProviderTypes(); _mainContext = MenuContextType.Construct <MenuContext>(selectedType, _writer); _currentContext = _mainContext; MenuLoop(); }