/// <summary> /// Process command. /// </summary> public void ProcessCommand() { string tInput = Input.TrimStart().TrimEnd(); var result = from value in BannedCommandNamespaces where tInput.StartsWith(value) select value; if (result.Count() > 0) { TerminalErrorEcho("Can't use this command namespace in this terminal!"); return; } TerminalInputProcessEventArgs args = new TerminalInputProcessEventArgs(tInput); OnInputProcessing(this, args); if (args.Cancel) { return; } AddInput(new TerminalInput(CurrentTitle.Base, Input, BaseFont, InputFont), true); if (!string.IsNullOrEmpty(tInput)) { if (tInput == "clear") { Clear(); return; } else if (tInput.StartsWith("release")) { release(tInput); } else if (tInput.StartsWith("cnc")) { cnc(tInput); } else if (Database != null) { mochaq(tInput); } else { AddInput(new TerminalInput(CurrentTitle.Base, "Command is not found!", Color.Red, BaseFont, InputFont), false); } } }
private void OnInputProcessing(object sender, TerminalInputProcessEventArgs e) { //Invoke. InputProcessing?.Invoke(sender, e); }