Method AddAndReturnIndex
AddAndReturnIndex(object)
Adds the specified item to the collection and returns the index at which it was added.
public virtual int AddAndReturnIndex(object item)
Parameters
itemobjectThe item to add to the collection. Can be any object supported by the collection.
Returns
- int
The zero-based index of the added item within the collection.
Remarks
If the collection allows duplicate items, the returned index corresponds to the newly added instance. If the item is not added at the end, the method returns the index of the new item as found in the collection.