CustomErrorCollection.RemoveAt(Int32) Método

Definição

Remove um objeto CustomError no local do índice especificado da coleção.Removes a CustomError object at the specified index location from the collection.

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

Parâmetros

index
Int32

O índice de coleção do objeto CustomError a ser removido.The collection index of the CustomError object to remove.

Exemplos

O exemplo de código a seguir mostra como remover o CustomError objeto no índice especificado.The following code example shows how to remove the CustomError object at the specified index. Consulte o exemplo de código no CustomErrorCollection tópico de classe para saber como obter a coleção.Refer to the code example in the CustomErrorCollection class topic to learn how to get the collection.

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

Comentários

O RemoveAt método insere um remove elemento na customErrors seção do arquivo de configuração no nível de hierarquia atual.The RemoveAt method inserts a remove element into the customErrors section of the configuration file at the current hierarchy level. Isso é para remover a referência ao add elemento definido nos arquivos de configuração pai em nível superior na hierarquia.This is to remove the reference to the add element defined in the parent configuration files at higher-level in the hierarchy.

Observação Os add elementos não são excluídos dos arquivos de configuração pai.Note The add elements are not deleted from the parent configuration files. Eles são simplesmente desativados.They are merely deactivated. No entanto, o RemoveAt método realmente os exclui no nível de hierarquia atual.However, the RemoveAt method does actually delete them at the current hierarchy level.

Aplica-se a