public void Send(Message message) { // displays list of messages to the UI _listMessages.Items.Clear(); _listMessages.DisplayMember = nameof(Message.ToString); _listMessages.Items.AddRange(_messages.ToArray()); }
private Message SaveData() { var message = new Message(); message.Subject = _txtSubject.Text; message.Body = _txtBody.Text; message.Contact = Contact; return(message); }
private void OnSend(object sender, EventArgs e) { if (!ValidateChildren()) { return; } var message = SaveData(); Message = message; DialogResult = DialogResult.OK; Close(); }