/// <summary> /// Raises the <see cref="CollectionItemAdded"/> event. /// </summary> /// <param name="key">The key of the item that was added to the list.</param> /// <param name="value">The item that was added to the list.</param> protected virtual void OnCollectionItemAdded(TKey key, TValue value) { CollectionItemAdded?.Invoke(this, key, value); if (suppressUntypedNotifications) { return; } untypedCollectionItemAdded?.Invoke(this, null, value); }
/// <summary> /// Raises the <see cref="CollectionItemAdded"/> event. /// </summary> /// <param name="index">The index at which the item was added to the list.</param> /// <param name="value">The item that was added to the list.</param> protected virtual void OnCollectionItemAdded(Int32 index, TValue value) { CollectionItemAdded?.Invoke(this, index, value); if (suppressUntypedNotifications) { return; } untypedCollectionItemAdded?.Invoke(this, index, value); }
/// <summary> /// Raises the <see cref="CollectionItemAdded"/> event. /// </summary> /// <param name="index">The index at which the item was added to the collection.</param> /// <param name="item">The item that was added.</param> private void OnCollectionItemAdded(Int32 index, Object item) => CollectionItemAdded?.Invoke(this, index, item);
/// <summary> /// Allows a derived object to notify a parent or sibling that an item has been added to the collection /// </summary> /// <param name="collectionName"></param> protected void RaiseCollectionItemAddedEvent(string collectionName) { CollectionItemAdded?.Invoke(this, new CollectionChangeEventArgs(CollectionChangeAction.Add, collectionName)); }