/// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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);
예제 #4
0
 /// <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));
 }