コード例 #1
0
ファイル: AccountForm.cs プロジェクト: crashatom/phoebemail
        public AccountForm(EmailAccount a)
        {
            InitializeComponent();

            textBoxUsername.Text = a.Username;
            textBoxPassword.Text = a.Password;
            textBoxNickname.Text = a.Nickname;
            textBoxServer.Text = a.Server;
            numericUpDownPort.Value = a.Port;
            checkBoxSsl.Checked = a.EnableSsl;
        }
コード例 #2
0
ファイル: AccountForm.cs プロジェクト: crashatom/phoebemail
        public EmailAccount GetAccount()
        {
            EmailAccount a = new EmailAccount();
            a.Username = textBoxUsername.Text;
            a.Password = textBoxPassword.Text;
            a.Nickname = textBoxNickname.Text;

            a.Server = textBoxServer.Text;
            a.Port = (int)numericUpDownPort.Value;
            a.EnableSsl = checkBoxSsl.Checked;
            return a;
        }
コード例 #3
0
ファイル: DataCenter.cs プロジェクト: crashatom/phoebemail
        public void LoadAccounts()
        {
            if (File.Exists(m_accountsFile))
            {
                string[] lines = File.ReadAllLines(m_accountsFile);

                foreach (string line in lines)
                {
                    if (!string.IsNullOrEmpty(line))
                    {
                        EmailAccount account = new EmailAccount(line.Split(','));
                        m_accounts.Add(account);
                    }
                }
            }   
        }
コード例 #4
0
ファイル: WrappedItem.cs プロジェクト: crashatom/phoebemail
 public WrappedItem(EmailAccount account)
 {
     m_account = account;
 }
コード例 #5
0
ファイル: MailJob.cs プロジェクト: crashatom/phoebemail
 public MailJob(EmailAccount account, object[] addresses)
 {
     m_account = account;
     m_addresses = addresses;
 }
コード例 #6
0
ファイル: DataCenter.cs プロジェクト: crashatom/phoebemail
 public void Remove(EmailAccount account)
 {
     m_accounts.Remove(account);
 }
コード例 #7
0
ファイル: DataCenter.cs プロジェクト: crashatom/phoebemail
 public void Add(EmailAccount account)
 {
     m_accounts.Add(account);
 }
コード例 #8
0
 public MailJob(EmailAccount account, object[] addresses)
 {
     m_account   = account;
     m_addresses = addresses;
 }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: zzilla/phoebemail
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (m_timer.Enabled)//表示timer正在工作
            {
                m_timer.Stop();
                m_timer.Enabled = false;
                OnDone();
                return;
            }
            else if (backgroundWorkerMailSender.IsBusy)
            {
                backgroundWorkerMailSender.CancelAsync();
                OnDone();
                return;
            }

            if (comboBoxAccounts.Items.Count < 1)
            {
                QMessageBox.ShowWarning("account can not be empty!");
                return;
            }
            else if (comboBoxAccounts.SelectedIndex < 0)
            {
                QMessageBox.ShowWarning("you must select an account!");
                return;
            }
            else if (String.IsNullOrEmpty(textBoxSubject.Text))
            {
                QMessageBox.ShowWarning("email subject can not be empty!");
                return;
            }
            else if (String.IsNullOrEmpty(richTextBoxBody.Text))
            {
                QMessageBox.ShowWarning("email body can not be empty!");
                return;
            }
            else if (listBoxAddresses.Items.Count <= 0)
            {
                QMessageBox.ShowWarning("recipients can not be empty!");
                return;
            }
            else
            {
                if (checkBoxTimedSend.Checked)
                {
                    if (dateTimePickerTimedSend.Value <= DateTime.Now)
                    {
                        QMessageBox.ShowError("the time is in the past!");
                        return;
                    }
                    m_timer.Interval = dateTimePickerTimedSend.Value.Subtract(DateTime.Now).TotalSeconds * 1000;
                }
                else
                {
                    m_timer.Interval = 1;
                }
            }

            WrappedItem  item = (WrappedItem)comboBoxAccounts.SelectedItem;
            EmailAccount a    = item.Account;

            a.Init(textBoxSubject.Text, richTextBoxBody.Text);
            object[] addresses = new object[listBoxAddresses.Items.Count];
            listBoxAddresses.Items.CopyTo(addresses, 0);
            job = new MailJob(a, addresses);
            m_timer.Start();
            buttonSend.Text    = "Cancel";
            buttonQuit.Enabled = false;

            this.Text = String.Format("{0} - waiting to send...", m_formText);
        }
コード例 #10
0
 public WrappedItem(EmailAccount account)
 {
     m_account = account;
 }
コード例 #11
0
ファイル: MainForm.cs プロジェクト: crashatom/phoebemail
 private ListViewItem BuildListViewItem(EmailAccount a)
 {
     ListViewItem item = new ListViewItem();
     item.Tag = a;
     ShowAccount(item);
     return item;
 }