IObservableCollection.cs 1.1 KB

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace MonoGame.Extended.Collections
  3. {
  4. /// <summary>Interface for collections that can be observed</summary>
  5. /// <typeparam name="T">Type of items managed in the collection</typeparam>
  6. public interface IObservableCollection<T>
  7. {
  8. /// <summary>Raised when an item has been added to the collection</summary>
  9. event EventHandler<ItemEventArgs<T>> ItemAdded;
  10. /// <summary>Raised when an item is removed from the collection</summary>
  11. event EventHandler<ItemEventArgs<T>> ItemRemoved;
  12. /// <summary>Raised when the collection is about to be cleared</summary>
  13. /// <remarks>
  14. /// This could be covered by calling ItemRemoved for each item currently
  15. /// contained in the collection, but it is often simpler and more efficient
  16. /// to process the clearing of the entire collection as a special operation.
  17. /// </remarks>
  18. event EventHandler Clearing;
  19. /// <summary>Raised when the collection has been cleared of its items</summary>
  20. event EventHandler Cleared;
  21. }
  22. }