Exemple #1
0
        public override void Display(out string o_UserInput)
        {
            o_UserInput = null;
            string userInput  = null;
            bool   legalInput = false;

            ScreenUtils.Clear();
            ScreenUtils.Display(base.m_MassageToDisplay.ToString());
            ScreenUtils.Display(m_StrOptions);

            while (!legalInput)
            {
                userInput = ScreenUtils.GetUserInput();
                try
                {
                    legalInput = isUserInputLegal(userInput);
                }
                catch (Exception exception)
                {
                    ScreenUtils.Display(exception.ToString());
                }
            }

            o_UserInput = userInput;
        }
        public void Display(out bool o_UserInput)
        {
            o_UserInput = false;
            bool   legalInput = false;
            string userInput  = null;

            ScreenUtils.Clear();
            base.Display();
            ScreenUtils.Display(@"1. Yes
2. No");
            while (!legalInput)
            {
                userInput = ScreenUtils.GetUserInput();
                try
                {
                    legalInput = isUserInputLegal(userInput);
                }
                catch (Exception exception)
                {
                    ScreenUtils.Display(exception.ToString());
                }
            }

            o_UserInput = userInput.Equals("1");
        }
Exemple #3
0
        public virtual void Display(out string o_UserInput)
        {
            o_UserInput = null;
            bool   inputLegal = false;
            string userInput  = null;

            ScreenUtils.Clear();
            base.Display();

            while (!inputLegal)
            {
                userInput = ScreenUtils.GetUserInput();
                try
                {
                    inputLegal = isUserInputLegal(userInput);
                }
                catch (Exception exception)
                {
                    ScreenUtils.Display(exception.ToString());
                }
            }

            o_UserInput = userInput;
        }