CustomErrorCollection.RemoveAt(Int32) メソッド

定義

指定したインデックス位置にある CustomError オブジェクトをコレクションから削除します。

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

パラメーター

index
Int32

削除する CustomError オブジェクトのコレクション インデックス。

次のコード例は、指定したインデックス位置にある CustomError オブジェクトを削除する方法を示しています。 コレクションを取得する方法については、 CustomErrorCollection クラスのトピックのコード例を参照してください。

// 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

注釈

RemoveAt メソッドは、現在の階層レベルの構成ファイルのremove セクションにcustomErrors要素を挿入します。 これは、階層内の上位レベルの親構成ファイルで定義されている add 要素への参照を削除するためです。

メモadd要素は、親構成ファイルから削除されません。 これらは単に非アクティブ化されます。 ただし、 RemoveAt メソッドでは、現在の階層レベルで実際に削除されます。

適用対象