public void updateStatus(msgStatus type, string msg, string _username) { switch (type) { case msgStatus.ERROR: this.richTextBox1.AppendText("[" + type + "]", Color.Red); break; case msgStatus.INFO: this.richTextBox1.AppendText("[" + type + "]", Color.Blue); break; case msgStatus.DEBUG: this.richTextBox1.AppendText("[" + type + "]", Color.Pink); break; default: this.richTextBox1.AppendText("[" + type + "]", Color.Aqua); break; } this.richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "]", Color.Yellow); this.richTextBox1.AppendText(" ", Color.Black); this.richTextBox1.AppendText(_username, Color.Yellow); this.richTextBox1.AppendText(": ", Color.White); this.richTextBox1.AppendText(msg, Color.White); this.richTextBox1.AppendText(Environment.NewLine, Color.Black); }
private void updateStatus(msgStatus type, string msg) { Console.WriteLine(info.username + " | " + msg); /*switch (type) * { * * case msgStatus.DEBUG: * var string = * richTextBox1.AppendText("[" + type + "]", Color.Pink); * break; * case msgStatus.ERROR: * richTextBox1.AppendText("[" + type + "]", Color.Red); * break; * case msgStatus.INFO: * richTextBox1.AppendText("[" + type + "]", Color.Blue); * break; * default: * richTextBox1.AppendText("[" + type + "]", Color.Aqua); * break; * } * richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "]", Color.Blue); * richTextBox1.AppendText(" ", Color.Black); * richTextBox1.AppendText(_username, Color.DarkBlue); * richTextBox1.AppendText(": ", Color.Black); * richTextBox1.AppendText(msg, Color.Black); * richTextBox1.AppendText(Environment.NewLine, Color.Black); */ }
private void SetText(string text, msgStatus msgStatus) { try { Color col = Color.Black; if (msgStatus == msgStatus.Recived) { col = Color.Blue; } if (msgStatus == msgStatus.Send) { col = Color.Green; } if (msgStatus == msgStatus.Connect) { col = Color.DarkOrange; log.LogTofile(text); } if (msgStatus == msgStatus.Error) { col = Color.Red; log.LogTofile(text); } if (msgStatus == msgStatus.Common) { col = Color.DarkSeaGreen; } if (msgStatus == msgStatus.Success) { col = Color.Violet; log.LogTofile(text); } richTextBox1.SelectionStart = richTextBox1.TextLength; richTextBox1.SelectionLength = 0; richTextBox1.SelectionColor = col; richTextBox1.AppendText(DateTime.Now.ToShortTimeString() + ": " + text); richTextBox1.AppendText("\n"); richTextBox1.SelectionColor = richTextBox1.ForeColor; } catch (Exception ex) { log.LogTofile("Ошибка вывода на экран (setText) " + ex.Message); } }
public void updateStatus(msgStatus type, String msg, String _username) { switch (type) { case msgStatus.DEBUG: richTextBox1.AppendText("[" + type + "]", Color.Pink); break; case msgStatus.ERROR: richTextBox1.AppendText("[" + type + "]", Color.Red); break; case msgStatus.INFO: richTextBox1.AppendText("[" + type + "]", Color.Blue); break; default: richTextBox1.AppendText("[" + type + "]", Color.Aqua); break; } richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "]", Color.Yellow); richTextBox1.AppendText(" ", Color.Black); richTextBox1.AppendText(_username, Color.Yellow); richTextBox1.AppendText(": ", Color.White); richTextBox1.AppendText(msg, Color.White); richTextBox1.AppendText(Environment.NewLine, Color.Black); }
private void updateStatus(msgStatus type, string msg, Color msgClr) { Console.WriteLine(info.username + " | " + msg); }
private void SetText(string text, msgStatus msgStatus) { try { Color col = Color.Black; if (msgStatus == msgStatus.Recived) { col = Color.Blue; } if (msgStatus == msgStatus.Send) { col = Color.Green; } if (msgStatus == msgStatus.Connect) { col = Color.DarkOrange; log.LogTofile(text); } if (msgStatus == msgStatus.Error) { col = Color.Red; log.LogTofile(text); } if (msgStatus == msgStatus.Common) { col = Color.DarkSeaGreen; } if (msgStatus == msgStatus.Success) { col = Color.Violet; log.LogTofile(text); } richTextBox1.SelectionStart = richTextBox1.TextLength; richTextBox1.SelectionLength = 0; richTextBox1.SelectionColor = col; richTextBox1.AppendText(DateTime.Now.ToShortTimeString() + ": " + text); richTextBox1.AppendText("\n"); richTextBox1.SelectionColor = richTextBox1.ForeColor; } catch (Exception ex) { log.LogTofile("Ошибка вывода на экран (setText) " + ex.Message); } }