예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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();
 }
예제 #4
0
 /// <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();
 }