Exemplo n.º 1
0
        public void CmdEnter(ConsoleWrapper c, ConsoleKeyInfo inf, Box<bool> quit)
        {
            CW.N();
            string ln = LE.Line;
            try
            {
                string[] args;
                args = Regex.Split(ln.Trim(), @"\s+");
                if (args.Length == 0) args = new string[] { "" };
                Cmds.Execute(args, quit);
                if (quit.Value == false) SetEditMode();
            }
            catch (Exception e)
            {
                if (e.InnerException != null) e = e.InnerException;

                if (e is Error)
                {
                    Error er_ = e as Error;
                    string s = FormatError(er_);
                    c.WN(s);
                }
                else
                {
                    c.WN(e.ToString());
                }
                LE.Init();
                LE.Ins(ln);
            }
        }