示例#1
0
        public void AppendLog(string input)
        {
            if (!input.EndsWith("&"))
            {
                input += "&";                                  //Since I can't seem to do it any other way.
            }
            Color currentColor = Color.White;

            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] == '&' && i < input.Length - 1)
                {
                    i++;                    //Move to colour code character.
                    if (IsColourCodeChar(input[i], out currentColor))
                    {
                        i++;
                        StringBuilder sb = new StringBuilder();
                        while (input[i] != '&')                         //Look at fixing this up so we don't always have to append & to the end..
                        {
                            sb.Append(input[i]);
                            i++;
                        }
                        i--;                         //Move back a character, as otherwise we go one too far and consume the next &.
                        RichTextBoxExtensions.AppendText(logBox, sb.ToString(), currentColor);
                    }
                }
            }
            RichTextBoxExtensions.AppendText(logBox, "\r\n", Color.White);
        }
示例#2
0
 void GotKicked(object sender, KickedEventArgs e)
 {
     RichTextBoxExtensions.AppendText(logBox, "Reconnecting: " + e.WillReconnect + ". " + e.Reason, Color.Red);
     RichTextBoxExtensions.AppendText(logBox, "\r\n", Color.White);
 }
示例#3
0
 void BotException(object sender, BotExceptionEventArgs e)
 {
     RichTextBoxExtensions.AppendText(logBox, e.Output, Color.Red);
     RichTextBoxExtensions.AppendText(logBox, "\r\n", Color.White);
 }