/// <summary> /// Initializes a new instance of the <see cref="LogMessageCollectionEventWatcher"/> class. /// </summary> /// <param name="collection">Collection to watch.</param> public LogMessageCollectionEventWatcher(ILogMessageCollectionCommon <LogMessage> collection) { mCollection = collection; mCollection.PropertyChanged += HandlePropertyChanged; mCollection.CollectionChanged += HandleCollectionChanged; }
/// <summary> /// Creates an event watcher for the <see cref="INotifyCollectionChanged.CollectionChanged"/> and the /// <see cref="INotifyPropertyChanged.PropertyChanged"/> event that assists with checking whether these /// events were called or not. /// </summary> /// <param name="collection">Collection to attach the watcher to.</param> /// <returns>The registered event watcher.</returns> public static LogMessageCollectionEventWatcher AttachEventWatcher(this ILogMessageCollectionCommon <LogMessage> collection) { return(new LogMessageCollectionEventWatcher(collection)); }