BelhardTraining.LessonIO.ConsoleMenu.AddItem C# (CSharp) 메소드

AddItem() 공개 메소드

public AddItem ( string text, System.Action itemCallback ) : void
text string
itemCallback System.Action
리턴 void
        public void AddItem(string text, Action itemCallback)
        {
            if (_items.Count == 10) return;

            _items.Add(new MenuItem { Text = text, ItemCallback = itemCallback });
        }

Usage Example

예제 #1
0
파일: Program.cs 프로젝트: bazile/Training
        static void Main()
        {
            ConsoleMenu menu = new ConsoleMenu();
            menu.AddItem("Бинарная сериализация", BinarySerializationDemo);
            menu.AddItem("XML сериализация"     , XmlSerializationDemo);
            menu.AddItem("JSON сериализация"    , JsonSerializationDemo);
            menu.AddItem("Выход"                , null);

            do
            {
                menu.Show();
            } while (!menu.ExitSelected);
        }
ConsoleMenu