Ejemplo n.º 1
0
        public void MainPage <T>()
        {
            if (!ConsolePages.ContainsKey(typeof(T)))
            {
                throw PageException.PageNotFound <T>();
            }

            var mainPage = ConsolePages[typeof(T)];

            history.Push(mainPage);
        }
Ejemplo n.º 2
0
        public void NavigateTo <T>()
        {
            if (!ConsolePages.ContainsKey(typeof(T)))
            {
                throw PageException.PageNotFound <T>();
            }

            var page = ConsolePages[typeof(T)];

            history.Push(page);
        }
Ejemplo n.º 3
0
        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);
        }