private void ShowChatForm() { ChatForm chatForm = new ChatForm(); chatForm.StartPosition = FormStartPosition.CenterParent; DialogResult dialogResult = chatForm.ShowDialog(this); if (dialogResult == DialogResult.OK) { StringBuilder sb = new StringBuilder(); sb.Append("<Message><MessageType>"); sb.Append("Chat"); sb.Append("</MessageType>"); sb.Append("<DateTime>"); sb.Append(DateTime.Now.ToString("HH:mm:ss")); sb.Append("</DateTime>"); sb.Append("<Category>"); sb.Append("</Category><TeamId>"); sb.Append(SecurityElement.Escape(chatForm.TeamId)); sb.Append("</TeamId><Text>"); sb.Append("(from " + SecurityElement.Escape(_teamId) + ") "); sb.Append(SecurityElement.Escape(chatForm.TextToSend) + "</Text><Forward>0</Forward><Synchronized>0</Synchronized></Message>"); _client.Enqueue(new CommunicationMessage(sb.ToString())); } }