private void OnContactSend(object sender, EventArgs e) { var contact = GetSelectedContact(); if (contact == null) { return; } var form = new SendMessageForm(); form.Contact = contact; if (form.ShowDialog(this) != DialogResult.OK) { return; } contact.Send(_messagingService, form.Message); }
private void SendMessage() { var item = GetSelectedMessage(); if (item == null) { return; } var form = new SendMessageForm(); form.Contact = item; if (form.ShowDialog(this) == DialogResult.Cancel) { return; } _database.EditContact(item.Body, form.Contact); RefreshMessage(); }
//event handler for message send private void OnSendMessage(object sender, EventArgs e) { var contact = GetSelectedContact(); if (contact == null) { return; } var form = new SendMessageForm(); form.CurrentContact = contact; form.Text = $"Message to {contact.Name}"; if (form.ShowDialog(this) != DialogResult.OK) { return; } Send(form.CurrentMessage); }