ParserErrorCollection.Insert(Int32, ParserError) Método
Definição
Insere o objeto ParserError especificado na coleção no índice especificado.Inserts the specified ParserError object into the collection at the specified index.
public:
void Insert(int index, System::Web::ParserError ^ value);
public void Insert (int index, System.Web.ParserError value);
member this.Insert : int * System.Web.ParserError -> unit
Public Sub Insert (index As Integer, value As ParserError)
Parâmetros
- index
- Int32
O índice dentro da coleção na qual inserir o ParserError.The index within the collection at which to insert the ParserError.
- value
- ParserError
O objeto ParserError a ser inserido na coleção.The ParserError object to insert into the collection.
Exemplos
O exemplo de código a seguir demonstra como inserir um ParserError objeto no índice especificado em uma ParserErrorCollection coleção.The following code example demonstrates how to insert a ParserError object at the specified index in a ParserErrorCollection collection.
// Insert a ParserError at index 0 of the collection.
ParserError error = new ParserError("Error", "Path", 1);
collection.Insert(0, error);
// Remove the specified ParserError from the collection.
collection.Remove(error);
' Insert a ParserError at index 0 of the collection.
Dim [error] As New ParserError("Error", "Path", 1)
collection.Insert(0, [error])
' Remove the specified ParserError from the collection.
collection.Remove([error])
Comentários
Use o Insert método para inserir um ParserError objeto existente em um índice específico dentro da coleção.Use the Insert method to insert an existing ParserError object at a particular index within the collection.
Você não pode adicionar o mesmo ParserError objeto à coleção mais de uma vez.You cannot add the same ParserError object to the collection more than once. Quando você chama o Insert método usando um ParserError que já está na coleção, a inserção falha.When you call the Insert method by using a ParserError that is already in the collection, the insertion fails. Use o Contains método antes da inserção para determinar se um determinado ParserError já está na coleção.Use the Contains method before the insertion to determine whether a particular ParserError is already in the collection. Para reposicionar um ParserError dentro da coleção, você deve primeiro removê-lo usando o Remove método e, em seguida, inseri-lo no índice desejado usando Insert .To reposition a ParserError within the collection, you must first remove it by using the Remove method and then insert it at the desired index by using Insert.