Bricklayer.Client.Interface.GameScreen.TextBox_TextChanged C# (CSharp) Method

TextBox_TextChanged() public method

Called when the content of the chatbox's text is changed
public TextBox_TextChanged ( object sender, TomShane e ) : void
sender object
e TomShane
return void
        void TextBox_TextChanged(object sender, TomShane.Neoforce.Controls.EventArgs e)
        {
            TextBox txtBox = sender as TextBox;
            //Trim to max length
            if (txtBox.Text.StartsWith(Game.Username + ": "))
                txtBox.Text = txtBox.Text.Substring((Game.Username + ": ").Length);
            if (txtBox.Text.Length > Bricklayer.Common.Networking.Messages.ChatMessage.MaxLength)
                txtBox.Text = txtBox.Text.Truncate(Bricklayer.Common.Networking.Messages.ChatMessage.MaxLength);
        }