OpenMetaverse.GUI.LocalChat.LogChat C# (CSharp) Method

LogChat() public method

public LogChat ( string name, ChatType type, string text, Color color ) : void
name string
type ChatType
text string
color Color
return void
        public void LogChat(string name, ChatType type, string text, Color color)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke((MethodInvoker)delegate { LogChat(name, type, text, color); });
            }
            else
            {
                _rtfOutput.SelectionStart = _rtfOutput.Text.Length;
                _rtfOutput.SelectionColor = color;
                DateTime now = DateTime.Now;
                string volume;
                if (type == ChatType.Shout) volume = " shouts";
                else if (type == ChatType.Whisper) volume = " whispers";
                else volume = string.Empty;
                _rtfOutput.SelectedText = string.Format("{0}[{1}:{2}] {3}{4}: {5}", Environment.NewLine, now.Hour.ToString().PadLeft(2, '0'), now.Minute.ToString().PadLeft(2, '0'), name, volume, text);
                _rtfOutput.ScrollToCaret();
            }
        }