Exemple #1
0
        private void bYEMAILToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fillmaildelegate f = new fillmaildelegate(fill_students);

            filling_students = true;
            IAsyncResult ira = f.BeginInvoke(2, null, null);
        }
 private void txtsearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (filling_students)
         {
             filling_students = false;
         }
         else
         {
             fillmaildelegate f = new fillmaildelegate(fill_students);
             filling_students = true;
             IAsyncResult ira = f.BeginInvoke(1, null, null);
         }
         txtsearch.SelectAll();
         lvstudents.Focus();
     }
 }
        void getmails()
        {
            if (!logged_in)
            {
                logged_in = clientlogin();
            }

            if (logged_in)
            {
                sbText.Text = "Checking new messages...";
                try
                {
                    if (!updating_emails)
                    {
                        if (!imapclient.IsCompressed)
                        {
                            imapclient.Compress();
                        }
                        imapclient.SelectInbox();
                        mail_ids        = imapclient.Search(Flag.All);
                        sbText.Text     = mail_ids.Count.ToString() + " messages found.";
                        updating_emails = true;
                        fm.BeginInvoke(0, null, null);
                    }
                    else
                    {
                        MessageBox.Show("Currently updating emails");
                    }
                }
                catch (Limilabs.Client.ServerException i)
                {
                    sbText.Text = "Unable to update emails:" + i.Message;
                    logged_in   = false;
                }
            }
            else
            {
                sbText.Text = "Not logged in.";
            }
        }