Example #1
0
            public Menu CreateMenu(params string[] choices)
            {
                var menu = new AlphaMenu();

                // Nackdel: upprepning av kod (foreach)
                foreach (var choice in choices)
                {
                    menu.Add(choice.Trim().ToUpper());
                }

                return(menu);
            }
Example #2
0
        public string RenderAlphaMenu()
        {
            var menu = new AlphaMenu("  Banana   ", " Apple   ");

            return(menu.Render());
        }