public void MainPage <T>() { if (!ConsolePages.ContainsKey(typeof(T))) { throw PageException.PageNotFound <T>(); } var mainPage = ConsolePages[typeof(T)]; history.Push(mainPage); }
public void NavigateTo <T>() { if (!ConsolePages.ContainsKey(typeof(T))) { throw PageException.PageNotFound <T>(); } var page = ConsolePages[typeof(T)]; history.Push(page); }
public ConsoleMenu AddPage <T>() where T : ConsolePage, new() { if (ConsolePages.ContainsKey(typeof(T))) { throw PageException.PageTypeExists <T>(); } var page = new T(); ConsolePages.Add(typeof(T), page); return(this); }