public ConsoleWindow() { this._completions = new CompletionsWindow(); this.Controls.Add(this._completions); this.InitializeComponent(); this._completions.Hide(); this._completions.ItemClicked += this.CompletionClicked; this._acceptKeys = Keys.Enter; this._previousDebugCommands = new List <string>(); this.MultilineInput = true; }
private void CompletionClicked(CompletionsWindow sender, string clicked) { string finalOutput = $"{clicked}"; var currentText = this.txtConsoleIn.Text; var dotIndex = this.txtConsoleIn.Text.LastIndexOf(".", StringComparison.Ordinal); if (dotIndex > -1) { finalOutput = $"{currentText.Substring(0, dotIndex)}.{clicked}"; } this.txtConsoleIn.Text = finalOutput; this.txtConsoleIn.Select(this.txtConsoleIn.TextLength, 0); this._completions.Hide(); }