Example #1
0
 public override void OnRegist(ContextContainer ctx)
 {
     if (ctx.Get <InputHistory>() == null)
     {
         ctx.Set(new InputHistory(100));
     }
 }
Example #2
0
        public static void StaticInit(string prompt)
        {
            if (_init)
            {
                return;
            }

            ctx = new ContextContainer();
            ctx.Set(new InputBuffer(prompt));

            _inputCursor = new InputCursor();

            RegisterKeyAction(ConsoleKey.Enter, new Enter());
            RegisterKeyAction(ConsoleKey.Backspace, new BackSpace());
            RegisterKeyAction(ConsoleKey.LeftArrow, new LeftArrow());
            RegisterKeyAction(ConsoleKey.RightArrow, new RightArrow());
            RegisterKeyAction(ConsoleKey.UpArrow, new UpArrow());
            RegisterKeyAction(ConsoleKey.DownArrow, new DownArrow());

            _init = true;
        }