public Menu <T> AddSpacer() { MenuOption <T> newOption = new MenuOption <T>() { IsSpace = true, Selectable = false }; this.Options.AddLast(newOption); return(this); }
public Menu <T> AddItem(T item) { MenuOption <T> newOption = new MenuOption <T>(item); this.Options.AddLast(newOption); if (this.Options.Count == 1) { this.CurrentOption = Options.First; } return(this); }
public void DrawMenu() { LinkedList <MenuOption <T> > .Enumerator e = this.Options.GetEnumerator(); while (e.MoveNext()) { MenuOption <T> currentOption = e.Current; if (currentOption.IsSpace) { Console.WriteLine(); } else { OptionFormatter.Invoke(currentOption.Item); } } Console.WriteLine(); Console.WriteLine(); RedrawCurrentOption(); DoMenuLoop(); }