Beispiel #1
0
        public void CombatChatBox(string lvMessage, string lvPrefix, int titleColorRtf, int textColorRtf)
        {
            RichTextBox lvControl = (RichTextBox)cvCombatChat.Controls.Find("txtCombatChat", true)[0];

            string rfString = RtfHelper.RtfFont() + RtfHelper.RtfColorTable() + @"\fs20\cf" + titleColorRtf.ToString() + @" \par " + lvPrefix + @"{\cf" + textColorRtf.ToString() + " " + lvMessage + "}";

            using (FileStream stream = new FileStream(Properties.Settings.Default.DataLocation + @"Active\Chat\Combat.txt", FileMode.Append, FileAccess.Write, FileShare.Read))
            {
                StreamWriter writer = new StreamWriter(stream);
                writer.WriteLine(rfString);
                writer.Flush();
                writer.Close();
            }

            btnSend.Focus();
        }