/// <summary> /// Handles when a console command was executed on the server. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ServerConsoleCommandEventArgs"/> instance containing the event data.</param> void Server_ConsoleCommandExecuted(Server sender, ServerConsoleCommandEventArgs e) { var eh = new EventHandler(delegate { AppendToConsole(e.Command, ConsoleTextType.Input); if (!string.IsNullOrEmpty(e.ReturnString)) { AppendToConsole(e.ReturnString, ConsoleTextType.InputReturn); } txtConsoleOut.ScrollToCaret(); }); txtConsoleOut.Invoke(eh); }
/// <summary> /// Handles when a console command was executed on the server. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ServerConsoleCommandEventArgs"/> instance containing the event data.</param> void Server_ConsoleCommandExecuted(Server sender, ServerConsoleCommandEventArgs e) { var eh = new EventHandler(delegate { AppendToConsole(e.Command, ConsoleTextType.Input); if (!string.IsNullOrEmpty(e.ReturnString)) AppendToConsole(e.ReturnString, ConsoleTextType.InputReturn); txtConsoleOut.ScrollToCaret(); }); txtConsoleOut.Invoke(eh); }
/// <summary> /// Handles when the server creates replies from console commands. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ServerConsoleCommandEventArgs"/> instance containing the event data.</param> static void Server_ConsoleCommandExecuted(Server sender, ServerConsoleCommandEventArgs e) { Console.WriteLine(e.ReturnString); Console.WriteLine(); }