예제 #1
0
        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());
        }
예제 #2
0
        private Message SaveData()
        {
            var message = new Message();

            message.Subject = _txtSubject.Text;
            message.Body    = _txtBody.Text;
            message.Contact = Contact;

            return(message);
        }
예제 #3
0
        private void OnSend(object sender, EventArgs e)
        {
            if (!ValidateChildren())
            {
                return;
            }

            var message = SaveData();

            Message      = message;
            DialogResult = DialogResult.OK;
            Close();
        }