Exemplo n.º 1
0
    public string InputString(string value)
    {
        var arguments = value.Split(' ');
        var command   = _commands.FirstOrDefault(_ => _.CompareNameApproximate(arguments[0]));

        if (command != null)
        {
            var context = new ConsoleCommandContext(arguments[1]);
            command.Execute(context);
        }

        return(string.Empty);
    }
Exemplo n.º 2
0
 public ShellView(ICremaHost cremaHost, ConsoleCommandContext commandContext)
 {
     InitializeComponent();
     this.writer = new LogTextWriter()
     {
         TextBox = this.LogBox
     };
     this.cremaHost               = cremaHost;
     this.cremaHost.Opening      += CremaHost_Opening;
     this.cremaHost.Opened       += CremaHost_Opened;
     this.cremaHost.Closed       += CremaHost_Closed;
     this.commandContext          = commandContext;
     this.commandContext.Out      = new ConsoleWriter(this.terminal);
     this.terminal.CommandContext = this.commandContext;
     this.SetPrompt();
     CremaLog.AddRedirection(this.writer, LogLevel.Info);
 }
Exemplo n.º 3
0
        public void Invoke(string command)
        {
            var context = new ConsoleCommandContext();

            Invoke(context, command);
        }
Exemplo n.º 4
0
 public override void Execute(ConsoleCommandContext context)
 {
     Debug.Log(context.GetArgument());
 }
Exemplo n.º 5
0
 public virtual void Execute(ConsoleCommandContext context)
 {
 }