#region Apache License 2.0 /* Nuclex .NET Framework Copyright (C) 2002-2024 Markus Ewald / Nuclex Development Labs Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #endregion // Apache License 2.0 using System; namespace Nuclex.Support.Collections { /// Interface for collections that can be observed /// Type of items managed in the collection public interface IObservableCollection { /// Raised when an item has been added to the collection event EventHandler> ItemAdded; /// Raised when an item is removed from the collection event EventHandler> ItemRemoved; /// Raised when an item is replaced in the collection event EventHandler> ItemReplaced; /// Raised when the collection is about to be cleared /// /// This could be covered by calling ItemRemoved for each item currently /// contained in the collection, but it is often simpler and more efficient /// to process the clearing of the entire collection as a special operation. /// event EventHandler Clearing; /// Raised when the collection has been cleared of its items event EventHandler Cleared; } } // namespace Nuclex.Support.Collections