Version

OnAddedToCollection Method (KeyedObjectBase)

Called when this object is being added to the supplied collection.
Syntax
'Declaration
 
Protected Overridable Sub OnAddedToCollection( _
   ByVal primaryCollection As KeyedObjectCollectionBase _
) 
protected virtual void OnAddedToCollection( 
   KeyedObjectCollectionBase primaryCollection
)

Parameters

primaryCollection
Collection that this object has been added to.
Remarks

The default implementation sets the PrimaryCollection reference to the supplied primaryCollection argument, if it hasn't already been set (either the base constructor, or a prior call to OnRemovedFromCollection should have nullified PrimaryCollection from any former collection's claim to ownership of this object.)

Inheritors overriding this method should always call this base implementation to assure the object has only one distinct primary collection.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also