Exemplo n.º 1
0
        public void ShowMenuWithResult()
        {
            ShowMenu();

            string input;

            while (!string.Equals(input = Console.ReadLine().ToLower(), "b"))
            {
                if (Parent == null && string.Equals(input, "q"))
                {
                    //退出程序
                    break;
                }

                int index = -1;
                if (int.TryParse(input, out index))
                {
                    HelperBase son = SonList[index];
                    if (son != null)
                    {
                        son.Execute();
                    }
                }
                ShowMenu();
            }
        }
Exemplo n.º 2
0
 protected void SetParent(HelperBase parent)
 {
     Parent = parent;
     Index  = parent.SonList.Count();
 }
Exemplo n.º 3
0
 public HelperBase(HelperBase parent, string description = "")
 {
     Description = description;
     SetParent(parent);
 }
Exemplo n.º 4
0
 public NavigatorItem(HelperBase parent, string description = "未添加功能描述", string doorPlate = "")
     : base(parent, description)
 {
     DoorPlate = doorPlate;
 }
Exemplo n.º 5
0
 public FunctionItem(HelperBase parent, Action action, string description = "未添加功能描述")
     : base(parent, description)
 {
     MyAction     = action;
     IsExecutable = true;
 }