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);
        }
示例#2
0
        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();
        }
示例#3
0
        //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);
        }