예제 #1
0
        public void MainPage <T>()
        {
            if (!ConsolePages.ContainsKey(typeof(T)))
            {
                throw PageException.PageNotFound <T>();
            }

            var mainPage = ConsolePages[typeof(T)];

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

            var page = ConsolePages[typeof(T)];

            history.Push(page);
        }
예제 #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);
        }