Udostępnij za pośrednictwem


SoapHeaderCollection.Insert(Int32, SoapHeader) Metoda

Definicja

Wstawia obiekt SoapHeader do SoapHeaderCollection określonego indeksu.

public:
 void Insert(int index, System::Web::Services::Protocols::SoapHeader ^ header);
public void Insert (int index, System.Web.Services.Protocols.SoapHeader header);
member this.Insert : int * System.Web.Services.Protocols.SoapHeader -> unit
Public Sub Insert (index As Integer, header As SoapHeader)

Parametry

index
Int32

Indeks oparty na zerze, w którym należy wstawić element SoapHeader do klasy SoapHeaderCollection.

header
SoapHeader

Element SoapHeader do wstawienia do .SoapHeaderCollection

Wyjątki

Parametr index nie jest prawidłowym indeksem w pliku SoapHeaderCollection.

Przykłady

mySoapHeader = gcnew MySoapHeader;
mySoapHeader->text = "This header is inserted before the first header";
mySoapHeaderCollection->Insert( 0, mySoapHeader );
mySoapHeader = new MySoapHeader();
mySoapHeader.text = "This header is inserted before the first header";
mySoapHeaderCollection.Insert(0, mySoapHeader);
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This header is inserted before the first header"
mySoapHeaderCollection.Insert(0, mySoapHeader)

Uwagi

index Jeśli parametr jest równy liczbie elementów w kolekcji, SoapHeader element jest dołączany na końcu kolekcji.

SoapHeader Elementy po punkcie wstawiania są przenoszone w dół, aby pomieścić nowy element.

Dotyczy

Zobacz też