bool HandleKeyEvent(QKeyEvent kevent) { if (kevent.Key() == (int)Qt.Key.Key_Return || kevent.Key() == (int)Qt.Key.Key_Enter) { if ((kevent.Modifiers() & (uint)Qt.KeyboardModifier.ControlModifier) == 0) { string html = textEdit.ToHtml(); if (m_Handler is ChatHandler) { string resource = m_ToComboBox.ItemData(m_ToComboBox.CurrentIndex); ((ChatHandler)m_Handler).Resource = (resource == "auto") ? null : resource; } m_Handler.Send(html); textEdit.Clear(); } else { textEdit.TextCursor().InsertText("\n"); } return(true); } else { return(false); } }
public void SendMessage(IChatHandler handler, string language, string text) { var bodyElement = handler.Account.Client.Document.CreateElement("body"); bodyElement.SetAttribute("xmlns:code", CODE_NS); bodyElement.SetAttribute("language", CODE_NS, language); bodyElement.InnerText = text; handler.Send(bodyElement); }
public void SendMessage(IChatHandler handler, string language, string text) { var bodyElement = handler.Account.Client.Document.CreateElement("body"); bodyElement.SetAttribute("xmlns:code", CODE_NS); bodyElement.SetAttribute("language", CODE_NS, language); bodyElement.InnerText = text; handler.Send(bodyElement); }