コード例 #1
0
        /// <summary>
        /// 選択(送信元)ボタン - Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonSelectMailFrom_Click(object sender, EventArgs e)
        {
            MailAddressForm       dialog = new MailAddressForm();
            MailAddressFormResult dr     = dialog.ShowDialog(this);

            if (dr == MailAddressFormResult.Cancel)
            {
                return;
            }

            this.textBoxMailFrom.Text = dialog.MailAddr.Trim();
        }
コード例 #2
0
        /// <summary>
        /// 選択(宛先)ボタン - Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonSelectMailTo_Click(object sender, EventArgs e)
        {
            MailAddressForm       dialog = new MailAddressForm();
            MailAddressFormResult dr     = dialog.ShowDialog(this);

            if (dr == MailAddressFormResult.Cancel)
            {
                return;
            }

            string mailAddr = dialog.MailAddr.Trim();
            string mailTo   = this.textBoxMailTo.Text.Trim();

            List <string> mailToList = new List <string>(mailTo.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries));

            if (mailToList.Contains(mailAddr))
            {
                return;
            }

            this.textBoxMailTo.Text = string.Format("{0}{1}{2}", mailTo, (0 < mailTo.Length) ? "\x20" : "", mailAddr);
        }