Ejemplo n.º 1
0
        private Ty Await_User_Input()
        {
            string userInput = string.Empty;

            try
            {
                InputContext = ConsoleInput.Capture(Pre_Handle_Input_Key);

                while (true)
                {
                    List <string> opts = Get_Valid_Options()?.ToList();
                    if (!ReferenceEquals(opts, null) && opts.Count > 0)
                    {
                        string strOpts = string.Join(", ", opts);
                        xLogEngine.Console(string.Concat(ANSI.WhiteBright("Options: "), ANSI.White(strOpts)));
                        Update();
                    }

                    try
                    {
                        UserInputSignal.Wait(taskCancel.Token);
                    }
                    catch (OperationCanceledException)
                    {/* Ignore */
                        Set_Input(string.Empty);
                        return(default);