using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
namespace TrackedFolders
{
///
/// A binding list with collection changed notifications.
///
/// a generic type
/// https://stackoverflow.com/questions/23339233/get-deleted-item-in-itemchanging-event-of-bindinglist
public class BindingListWithCollectionChanged : BindingList
{
#region Public Events & Delegates
public event EventHandler CollectionChanged;
#endregion
#region Constructors, Destructors and Finalizers
public BindingListWithCollectionChanged(IEnumerable list) : this(new ObservableCollection(list))
{
}
private BindingListWithCollectionChanged(ObservableCollection observableCollection) : base(
observableCollection)
{
observableCollection.CollectionChanged += (sender, args) => CollectionChanged?.Invoke(sender, args);
}
public BindingListWithCollectionChanged() : this(new ObservableCollection())
{
}
#endregion
}
}