/// <summary>
 /// Subscribes to an <see cref="IObservable{EventEntry}" /> using a <see cref="ApplicationInsightsSink" />.
 /// </summary>
 /// <param name="eventStream">The event stream. Typically this is an instance of <see cref="ObservableEventListener" />.</param>
 /// <returns>
 /// A subscription to the sink that can be disposed to unsubscribe the sink and dispose it, or to get access to the sink instance.
 /// </returns>
 public static SinkSubscription<WindowsFormSink> LogToWindowsForm(this IObservable<EventEntry> eventStream,
     Form1 form1)
 {
     var sink = new WindowsFormSink(form1);
     var subscription = eventStream.Subscribe(sink);
     return new SinkSubscription<WindowsFormSink>(subscription, sink);
 }
Example #2
0
        /// <summary>
        /// Subscribes to an <see cref="IObservable{EventEntry}" /> using a <see cref="ApplicationInsightsSink" />.
        /// </summary>
        /// <param name="eventStream">The event stream. Typically this is an instance of <see cref="ObservableEventListener" />.</param>
        /// <returns>
        /// A subscription to the sink that can be disposed to unsubscribe the sink and dispose it, or to get access to the sink instance.
        /// </returns>
        public static SinkSubscription <WindowsFormSink> LogToWindowsForm(this IObservable <EventEntry> eventStream,
                                                                          Form1 form1)
        {
            var sink         = new WindowsFormSink(form1);
            var subscription = eventStream.Subscribe(sink);

            return(new SinkSubscription <WindowsFormSink>(subscription, sink));
        }