public static SinkSubscription <EmailSink> LogToEmail(this IObservable <EventEntry> eventStream, string host, int port, string recipients, string subject, string credentials, IEventTextFormatter formatter = null) { var sink = new EmailSink(host, port, recipients, subject, credentials, formatter); var subscription = eventStream.Subscribe(sink); return(new SinkSubscription <EmailSink>(subscription, sink)); }
public IObserver <EventEntry> CreateSink(XElement element) { var host = (string)element.Attribute("host"); var port = (int)element.Attribute("port"); var recipients = (string)element.Attribute("recipients"); var subject = (string)element.Attribute("subject"); var credentials = (string)element.Attribute("credentials"); var formatter = FormatterElementFactory.Get(element); var sink = new EmailSink(host, port, recipients, subject, credentials, formatter); return(sink); }