Ejemplo n.º 1
0
        public override void Write(string message)
        {
            MockEmailMessage mailMessage = new MockEmailMessage(this.emailData.ToAddress,
                                                                this.emailData.FromAddress,
                                                                this.emailData.SubjectLineStarter,
                                                                this.emailData.SubjectLineEnder,
                                                                this.emailData.SmtpServer,
                                                                this.emailData.SmtpPort,
                                                                message,
                                                                this.Formatter);

            mailMessage.Send();
            this.numberMessagesSent++;
        }
 public override void TraceData(TraceEventCache eventCache,
                                string source,
                                TraceEventType eventType,
                                int id,
                                object data)
 {
     EmailMessage message = null;
     if (data is LogEntry)
     {
         message = new MockEmailMessage(this.emailData, data as LogEntry, Formatter);
         message.Send();
         this.numberMessagesSent++;
     }
     else if (data is string)
     {
         this.Write(data);
     }
     else
     {
         base.TraceData(eventCache, source, eventType, id, data);
     }
 }