Språk

ServiceDescriptionFormatExtensionCollection.Insert(Int32, Object) Metod

Definition

Lägger till ServiceDescriptionFormatExtension det angivna ServiceDescriptionFormatExtensionCollection i det angivna nollbaserade indexet.

public:
 void Insert(int index, System::Object ^ extension);
public void Insert(int index, object extension);
member this.Insert : int * obj -> unit
Public Sub Insert (index As Integer, extension As Object)

Parametrar

index
Int32

Det nollbaserade index där parametern ska infogas extension .

extension
Object

Att ServiceDescriptionFormatExtension lägga till i samlingen.

Undantag

Parametern index är mindre än noll.

-eller-

Parametern index är större än Count.

Exempel

// Insert 'MyFormatExtension' object.
myCollection->Insert( 0, myFormatExtensionObject );
Console::WriteLine( "'myFormatExtensionObject' is inserted to collection." );
// Insert 'MyFormatExtension' object.
myCollection.Insert(0,myFormatExtensionObject);
Console.WriteLine("'myFormatExtensionObject' is inserted to collection.");
' Insert 'MyFormatExtension' object.
myCollection.Insert(0, myFormatExtensionObject)
Console.WriteLine("'myFormatExtensionObject' is inserted to collection.")

Kommentarer

Om antalet objekt i samlingen redan är lika med samlingens kapacitet, fördubblas kapaciteten genom att den interna matrisen omplaceras automatiskt innan det nya elementet infogas.

Om parametern index är lika med Countläggs parametern extension till i slutet av ServiceDescriptionFormatExtensionCollection.

Elementen efter insättningspunkten flyttas ned för att rymma det nya elementet.

Gäller för