コード例 #1
0
        public static List <GuerrillaMail.Email> WaitEmail(this GuerrillaMail Email, Func <GuerrillaMail.Email, bool> Verify = null, int WaitMin = 10)
        {
            var Mails = new List <GuerrillaMail.Email>();

            DateTime Limit = DateTime.Now.AddMinutes(WaitMin);

            while (Mails.Count == 0)
            {
                ThreadTools.Wait(10000, true);
                if (DateTime.Now > Limit)
                {
                    throw new Exception("Timeout");
                }

                if (Verify == null)
                {
                    Mails = Email.GetAllEmails();
                }
                else
                {
                    Mails = Email.GetAllEmails().Where(Verify).ToList();
                }
            }

            return(Mails);
        }
コード例 #2
0
 public static void ClearEmail(this GuerrillaMail Email, bool Wait = false)
 {
     Email.DeleteEmails((from x in Wait ? Email.WaitEmail() : Email.GetAllEmails() select x.mail_id.ToString()));
 }