示例#1
0
 /// <summary>
 /// Handles the OnRecieveErrorLog event of the Logger control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="MCForge.Utils.LogEventArgs"/> instance containing the event data.</param>
 /// <remarks></remarks>
 private static void Logger_OnRecieveErrorLog(object sender, LogEventArgs e) {
     ClearCurrentConsoleLine();
     var prevColor = Console.ForegroundColor;
     Console.ForegroundColor = ConsoleColor.Red;
     WriteLine("[Error] " + e.Message);
     Console.ForegroundColor = prevColor;
 }
示例#2
0
 public static void OnLog(object sender, LogEventArgs args)
 {
     if (args == null) return;
     if (!DebugMode && args.LogType == LogType.Debug)
         return;
     var tColor = ColorUtils.ToConsoleColor(args.TextColor);
     var bColor = ColorUtils.ToConsoleColor(args.BackgroundColor);
     Console.ForegroundColor = tColor;
     Console.BackgroundColor = bColor;
     Console.WriteLine(args.Message.PadRight(Console.WindowWidth - 1));
     Console.ResetColor();
 }
 void Logger_OnRecieveLog(object sender, LogEventArgs e) {
     DrawText(e.Message);
 }
示例#4
0
 /// <summary>
 /// Handles the OnRecieveLog event of the Logger control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="message">The <see cref="MCForge.Utils.LogEventArgs"/> instance containing the event data.</param>
 /// <remarks></remarks>
 private static void Logger_OnRecieveLog(object sender, LogEventArgs message) {
     ClearCurrentConsoleLine();
     WriteLine(message.Message, FindNearestConsoleColor(message.TextColor), FindNearestConsoleColor(message.BackgroundColor));
     WriteInputLine("> ", input);
 }
        void Logger_OnRecieveLog(object sender, LogEventArgs e)
        {
            if ( InvokeRequired ) {
                BeginInvoke((MethodInvoker)delegate { Logger_OnRecieveLog(sender, e); });
                return;
            }

            txtLog.AppendLog(e.Message + Environment.NewLine);
        }