private void button1_Click(object sender, EventArgs e) { MessageType messageType = MessageType.Info; if (comboBoxMessageType.SelectedItem != null) { messageType = (MessageType)Enum.Parse(typeof(MessageType), comboBoxMessageType.SelectedItem.ToString()); } using (NotifyClient notifyClient = new NotifyClient()) { notifyClient.NotifyAll(messageType, DateTime.Now, textBoxTeamId.Text, textBoxCategory.Text, textBoxText.Text); } }
public void NotifyAll(MessageType messageType, DateTime dateTime, string teamId, string category, string text) { ThreadPool.QueueUserWorkItem(delegate { try { using (NotifyClient notifyClient = new NotifyClient()) { notifyClient.NotifyAll(messageType, dateTime, teamId, category, text); } } catch { } }, null); }