public void ShowExplorerForImplementation(List <UserDirectoryClass> Items, IExecuteble action, string message) { UserDirectoryClass selectedItem = null; int cLevel = 0; do { Console.WriteLine(message); selectedItem = ShowExplorerLevel(Items, Items, cLevel); DisplayImplementationFunctionKey(); var key = Console.ReadKey(); if (key.Key == ConsoleKey.DownArrow) { AddCursorPosition(Items, cLevel); } else if (key.Key == ConsoleKey.UpArrow) { DecCursorPosition(Items, cLevel); } else if (key.Key == ConsoleKey.Enter) { DoActionForImplement(selectedItem, action); break; } else if (key.Key == ConsoleKey.F10) { break; } Console.Clear(); } while (true); }
private void DoActionForImplement(UserDirectoryClass selected, IExecuteble action) { action.Execute(selected); }