private async Task RenderSelectedScreen(string selection) { ConsoleWrapper.ClearScreen(); int.TryParse(selection, out var selectionAsNumber); var indexOfSelection = selectionAsNumber - 1; var screenToActivate = Screens.ElementAt(indexOfSelection); await screenToActivate.Activated(); }
private void ShowPreviousScreen() { int screenIdx = Screens.IndexOf(CurrentScreen); if (screenIdx < 1) { LogTo.Error("ShowPreviousScreen called with invalid CurrentScreen: Screens.IndexOf(CurrentScreen) < 1"); return; } ShowScreen(Screens.ElementAt(screenIdx - 1)); }