예제 #1
0
        /// <summary>
        /// Пользователь ввёл текст и нажал Enter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void printMessageIrcRichTextBox_EditFinished(object sender, EnterPushedEventArgs e)
        {
            if (this.irtbPrintMessage == null)
            {
                return;
            }

            if (this.irtbPrintMessage.InvokeRequired)
            {
                var eventHandler = new EventHandler <EnterPushedEventArgs>(printMessageIrcRichTextBox_EditFinished);
                this.BeginInvoke(eventHandler, sender, e);
            }
            else
            {
                if (Cmd != null)
                {
                    if (string.IsNullOrWhiteSpace(e.Message))
                    {
                        return;
                    }

                    var msg = e.Message.Trim();

                    if (UISettings.Default.MessagesColor != 1 && msg[0] != Special.Color && msg[0] != Special.CmdStarter)
                    {
                        msg = string.Format("{1}{0:D2}{2}", UISettings.Default.MessagesColor, Special.Color, msg);
                    }

                    Cmd(this, msg);
                }

                this.irtbPrintMessage.Clear();
            }
        }
예제 #2
0
 void irtbTopic_EditFinished(object sender, EnterPushedEventArgs e)
 {
     irtbTopic.ReadOnly = true;
     irtbTopic.Rollback();
     SetTopic(e.Message.Trim());
     this.irtbPrintMessage.Focus();
 }