Beispiel #1
0
        private Message Savedata()
        {
            var message = new Message();

            message.Subject        = _txtSubject.Text;
            message.Body           = _txtBody.Text;
            message.MessageContact = CurrentContact.Address;

            return(message);
        }
Beispiel #2
0
        private void OnSave(object sender, EventArgs e)
        {
            if (!ValidateChildren())
            {
                return;
            }

            var message = Savedata();

            try
            {
                ObjectValidator.Validate(message);
            } catch (ValidationException)
            {
                MessageBox.Show(this, "Message is not valid.", "Error", MessageBoxButtons.OK);
                return;
            }
            CurrentMessage = message;
            DialogResult   = DialogResult.OK;
            Close();
        }
Beispiel #3
0
 public void Send(Message message)
 {
     _txtSentMessages.Text += $"To: {message.MessageContact}\r\nSubject: {message.Subject}\r\n{message.Body}\r\n\r\n";
     return;
 }