Example #1
0
 /// <summary>
 ///   Starts monitoring <paramref name="eventSource"/> for events defined in the type parameter <typeparamref name="T"/>.
 /// </summary>
 /// <param name="eventSource">The object for which to monitor the events.</param>
 /// <typeparam name="T">The type defining the events it should monitor.</typeparam>
 /// <exception cref = "ArgumentNullException">Thrown if <paramref name="eventSource"/> is Null.</exception>
 public static void MonitorEvents <T>(this object eventSource)
 {
     // SMELL: This static stuff needs to go at the some point.
     EventMonitor.AddRecordersFor(eventSource, source => BuildRecorders(source, typeof(T)));
 }
Example #2
0
 /// <summary>
 ///   Starts monitoring an object for its <see cref="INotifyPropertyChanged.PropertyChanged"/> events.
 /// </summary>
 /// <exception cref = "ArgumentNullException">Thrown if eventSource is Null.</exception>
 public static void MonitorEvents(this INotifyPropertyChanged eventSource)
 {
     EventMonitor.AddRecordersFor(eventSource, source => BuildRecorders((INotifyPropertyChanged)source));
 }
Example #3
0
 /// <summary>
 ///   Starts monitoring an object for its events.
 /// </summary>
 /// <exception cref = "ArgumentNullException">Thrown if eventSource is Null.</exception>
 public static void MonitorEvents(this object eventSource)
 {
     EventMonitor.AddRecordersFor(eventSource, BuildRecorders);
 }