示例#1
0
 private void AddToListNullException(NullException emailnullException, List<Sender> exceptionList,string toAddress)
 {
     emailnullException.Message = _errorMessage.Message;
     emailnullException.Source = _errorMessage.Source;
     emailnullException.ToAddress = toAddress;
     exceptionList.Add(emailnullException);
 }
示例#2
0
        public void Handle()
        {
            List<Sender> exceptionList=new List<Sender>();

            if(_errorMessage.InnerException==null)
            {
                var emailnullException=new NullException(new EmailException());
                AddToListNullException(emailnullException, exceptionList, "*****@*****.**");

                var smsnullException = new NullException(new SmsException());
                AddToListNullException(smsnullException, exceptionList, "07771216871");

                var lognullException = new NullException(new LogException());
                AddToListNullException(lognullException, exceptionList, "nulllog.txt");
            }
            else
            {
                var emailsimpleException = new SimpleExpection(new EmailException());
                AddToListSimpleException(emailsimpleException, exceptionList, "*****@*****.**");

                var smsSimpleException = new SimpleExpection(new SmsException());
                AddToListSimpleException(smsSimpleException, exceptionList, "07771216872");

                var lognsimpleException = new SimpleExpection(new LogException());
                AddToListSimpleException(lognsimpleException, exceptionList, "simplelog.txt");

            }
            foreach (var exp in exceptionList)
            {
                 sendStatus.Add(exp.Send());
            }
        }