Bahasa

CustomErrorCollection.RemoveAt(Int32) Metode

Definisi

CustomError Menghapus objek di lokasi indeks yang ditentukan dari koleksi.

public:
 void RemoveAt(int index);
public void RemoveAt(int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

Parameter

index
Int32

Indeks koleksi objek yang CustomError akan dihapus.

Contoh

Contoh kode berikut menunjukkan cara menghapus CustomError objek pada indeks yang ditentukan. Lihat contoh kode dalam CustomErrorCollection topik kelas untuk mempelajari cara mendapatkan koleksi.

// Using method RemoveAt.
if (!customErrorsSection.SectionInformation.IsLocked)
{
    // Remove the error at 0 index
    customErrorsCollection.RemoveAt(0);
    configuration.Save();
}
' Using method RemoveAt.
If Not customErrorsSection.SectionInformation.IsLocked Then
   ' Remove the error at 0 index
   customErrorsCollection.RemoveAt(0)
   configuration.Save()
End If

Keterangan

Metode RemoveAt ini menyisipkan remove elemen ke bagian customErrors file konfigurasi pada tingkat hierarki saat ini. Ini untuk menghapus referensi ke elemen yang add ditentukan dalam file konfigurasi induk pada tingkat yang lebih tinggi dalam hierarki.

Catatan Elemen add tidak dihapus dari file konfigurasi induk. Mereka hanya dinonaktifkan. Namun, metode ini RemoveAt benar-benar menghapusnya pada tingkat hierarki saat ini.

Berlaku untuk