Exemplo n.º 1
0
        /// <summary>
        /// Method for remove the selected mail message.
        /// </summary>
        public void DeleteAllMessages()
        {
            Facade facade = Facade.GetInstance();

            DataGridViewRowCollection rows = this.dataGridView.Rows;

            for (int i = rows.Count - 1; i >= 0; i--)
            {
                MailMessage mailMessage = (MailMessage)rows[i].DataBoundItem;
                facade.DeleteMessage(mailMessage, Constants.Inbox);
                this.dataGridView.Rows.Remove(rows[i]);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method for remove the selected mail message.
        /// </summary>
        public void DeleteSelectedMessage()
        {
            Facade facade  = Facade.GetInstance();
            string mailbox = MainForm.GetInstance().GetSelectedMailbox();

            DataGridViewSelectedRowCollection rows = this.dataGridView.SelectedRows;

            for (int i = rows.Count - 1; i >= 0; i--)
            {
                MailMessage mailMessage = (MailMessage)rows[i].DataBoundItem;
                facade.DeleteMessage(mailMessage, mailbox);
                this.dataGridView.Rows.Remove(rows[i]);
            }

            this.Refresh();
        }