ParserError Classe
Definição
Representa um erro ou aviso do analisador.Represents a parser error or warning. Essa classe não pode ser herdada.This class cannot be inherited.
public ref class ParserError sealed
[System.Serializable]
public sealed class ParserError
[<System.Serializable>]
type ParserError = class
Public NotInheritable Class ParserError
- Herança
-
ParserError
- Atributos
Exemplos
O exemplo de código a seguir demonstra como adicionar um novo erro de analisador a um ParserErrorCollection objeto.The following code example demonstrates how to add a new parser error to a ParserErrorCollection object.
// Add a ParserError to the collection.
collection.Add(new ParserError("ErrorName", "Path", 1));
' Add a ParserError to the collection.
collection.Add(New ParserError("ErrorName", "Path", 1))
Comentários
Um ParserError objeto representa um erro que é criado quando uma HttpParseException exceção é gerada.A ParserError object represents an error that is created when an HttpParseException exception is thrown. Um objeto de erro do analisador pode conter texto de mensagem de erro, um caminho virtual para o arquivo em que o erro ocorreu e o número de linha subsequente do erro nesse arquivo.A parser error object can contain error message text, a virtual path to the file where the error occurred, and the subsequent line number of the error in that file. Se mais de um erro do analisador ocorrer ou se você quiser armazenar vários erros do analisador em um local centralizado, use o ParserErrorCollection objeto.If more than one parser error occurs or you want to store multiple parser errors in a centralized location, use the ParserErrorCollection object.
Um erro do analisador é do tipo HttpException .A parser error is of the type HttpException. Para obter mais informações sobre exceções e como tratá-las, consulte tratamento e lançamento de exceções no .net.For more information on exceptions and how to handle them, see Handling and throwing exceptions in .NET.
Construtores
| ParserError() |
Inicializa uma nova instância da classe ParserError.Initializes a new instance of the ParserError class. |
| ParserError(String, String, Int32) |
Inicializa uma nova instância da classe ParserError usando o texto de erro, o caminho virtual e o número de linha de origem especificados.Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number. |
Propriedades
| ErrorText |
Obtém ou define uma cadeia de caracteres que representa o erro para o objeto ParserError.Gets or sets a string that represents the error for the ParserError object. |
| Line |
Obtém ou define o número de linha de origem em que o erro ocorre.Gets or sets the line number of the source at which the error occurs. |
| VirtualPath |
Obtém ou define o caminho virtual do arquivo que estava sendo analisado quando ocorreu o erro.Gets or set the virtual path of the file that was being parsed when the error occurred. |
Métodos
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |