Redigera

Dela via


IPEndPointCollection.InsertItem(Int32, IPEndPoint) Method

Definition

Inserts an IPEndPoint element into the IPEndPointCollection at the specified index.

protected:
 override void InsertItem(int index, System::Net::IPEndPoint ^ item);
protected override void InsertItem (int index, System.Net.IPEndPoint item);
override this.InsertItem : int * System.Net.IPEndPoint -> unit
Protected Overrides Sub InsertItem (index As Integer, item As IPEndPoint)

Parameters

index
Int32

The zero-based index at which item should be inserted.

item
IPEndPoint

The IPEndPoint object to insert. The value can be null for reference types.

Exceptions

The index parameter is less than zero

-or-

the index parameter is greater than the current count of items in the IPEndPointCollection.

The item parameter is null.

Remarks

IPEndPointCollection does not accept null as a valid value. IPEndPointCollection allows duplicate elements.

If index is equal to current count of items in the IPEndPointCollection , then the item is added to the end of IPEndPointCollection.

This method is an O(n) operation, where n is Collection<T>.Count.

Applies to