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); }
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); }
public void Invoke(string command) { var context = new ConsoleCommandContext(); Invoke(context, command); }
public override void Execute(ConsoleCommandContext context) { Debug.Log(context.GetArgument()); }
public virtual void Execute(ConsoleCommandContext context) { }