Sdílet prostřednictvím


ProfileSettingsCollection.Insert(Int32, ProfileSettings) Metoda

Definice

Vloží zadaný ProfileSettings objekt do zadaného indexu v kolekci.

public:
 void Insert(int index, System::Web::Configuration::ProfileSettings ^ authorizationSettings);
public void Insert (int index, System.Web.Configuration.ProfileSettings authorizationSettings);
member this.Insert : int * System.Web.Configuration.ProfileSettings -> unit
Public Sub Insert (index As Integer, authorizationSettings As ProfileSettings)

Parametry

index
Int32

Index ProfileSettings objektu v kolekci.

authorizationSettings
ProfileSettings

Objekt ProfileSettings , který chcete vložit do kolekce.

Výjimky

Objekt ProfileSettings , který chcete přidat, již v kolekci existuje, index je neplatný nebo je kolekce jen pro čtení.

Příklady

Následující příklad kódu ukazuje, jak použít metodu Insert . Tento příklad kódu je součástí většího příkladu poskytnutého HealthMonitoringSection pro třídu.

// Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"));
' Insert an ProfileSettings object into the Profiles collection property.
healthMonitoringSection.Profiles.Insert(1, new ProfileSettings("Default2"))

Poznámky

Pokud se index parametr rovná počtu položek v kolekci, je položka připojena ke konci kolekce.

Platí pro

Viz také