Possible Duplicate:
List<T> vs BindingList<T> Advantages/DisAdvantages
what is the difference between IList and IBindingList ? When to use what and where 开发者_开发问答not to use what in C# ? public interface IBindingList : IList, ICollection, IEnumerable
They are designed for different scenarios
IList
is designed to be a very efficient container of objects. It's minimalisticIBindingList
is designed to be a container of objects which provides a richer API that enables more scenarios such as UI data binding.
If you dig into the APIs you'll find that IBindingList
has a much richer event collection than IList
(which has none). It takes the trade off of extra overhead to provide a richer API that fits more scenarios such as UI data binding.
It's good practise to use the interface which provides just the functionality you need and nothig more. For example, if you only need sequential access to the collection IEnuerable should suffice.
I'm afraid I can't help you with your main question about the difference between IBindingList and IList.
IList is simple data structure used for holding some data and it can grow dynamically and it includes rest of the normal features of List
Whereas the Binding list is used for binding data between some control and a collection because it notifies both control and collection when there is a change which helps in specially UI based application
精彩评论