The default implementation of this method determines whether value is nullNothingnullptra null reference (Nothing in Visual Basic), and, if so, throws ArgumentNullException. It is intended to be overridden by a derived class to perform additional action when the specified element is validated.
The On* methods are invoked only on the instance returned by the List property, but not on the instance returned by the InnerList property.
The default implementation of this method is an O(1) operation.
Notes to Implementers: This method allows implementers to define processes that must be performed when executing the standard behavior of the underlying System.Collections..::.ArrayList. By defining this method, implementers can add functionality to inherited methods without having to override all other methods.
OnValidate can be used to impose restrictions on the type of objects that are accepted into the collection. The default implementation prevents nullNothingnullptra null reference (Nothing in Visual Basic) from being added to or removed from the underlying System.Collections..::.ArrayList.
OnValidate is called prior to OnInsert, OnRemove, and OnSet.