CultureNotFoundException Classe
Definição
A exceção que é gerada quando um método que tenta construir uma cultura que não está disponível.The exception that is thrown when a method attempts to construct a culture that is not available.
public ref class CultureNotFoundException : ArgumentException
public class CultureNotFoundException : ArgumentException
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CultureNotFoundException : ArgumentException
type CultureNotFoundException = class
inherit ArgumentException
type CultureNotFoundException = class
inherit ArgumentException
interface ISerializable
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CultureNotFoundException = class
inherit ArgumentException
interface ISerializable
Public Class CultureNotFoundException
Inherits ArgumentException
- Herança
- Herança
- Atributos
- Implementações
Comentários
Uma CultureNotFoundException exceção é lançada sempre que a construção de uma cultura inválida é eventualmente tentada dentro de um método.A CultureNotFoundException exception is thrown whenever the construction of an invalid culture is eventually attempted within a method. Normalmente, essa exceção é lançada quando uma chamada para um dos seguintes métodos falha ao criar ou retornar uma cultura:Most commonly, this exception is thrown when a call to one of the following methods fails to create or return a culture:
CultureInfo.CultureInfo construtores.CultureInfo.CultureInfo constructors.
O método CultureInfo.CreateSpecificCulture.The CultureInfo.CreateSpecificCulture method.
O método CultureInfo.GetCultureInfo.The CultureInfo.GetCultureInfo method.
Aviso
No Windows 7 e sistemas operacionais posteriores, o .NET Framework recupera dados de cultura do sistema operacional.On Windows 7 and later operating systems, the .NET Framework retrieves culture data from the operating system. A CultureNotFoundException exceção será gerada se o sistema operacional não conseguir localizar a cultura e a cultura não for uma cultura personalizada ou uma cultura de substituição.The CultureNotFoundException exception is thrown if the operating system is unable to find the culture, and the culture is not a custom culture or a replacement culture.
Se o código de chamada tentar instanciar um CultureInfo objeto usando um nome de cultura, a InvalidCultureName Propriedade conterá o nome inválido e a HasValue Propriedade do Nullable<T> objeto retornado pela InvalidCultureId propriedade será false
.If the calling code attempted to instantiate a CultureInfo object by using a culture name, the InvalidCultureName property contains the invalid name, and the HasValue property of the Nullable<T> object returned by the InvalidCultureId property is false
. Se o código de chamada tentar instanciar um CultureInfo objeto usando um identificador de cultura, a Value Propriedade do Nullable<T> objeto retornado pela InvalidCultureId Propriedade conterá o identificador inválido e o valor da InvalidCultureName propriedade será null
.If the calling code attempted to instantiate a CultureInfo object by using a culture identifier, the Value property of the Nullable<T> object returned by the InvalidCultureId property contains the invalid identifier, and the value of the InvalidCultureName property is null
.
CultureNotFoundException usa o COR_E_ARGUMENT HRESULT, que tem o valor 0x80070057.CultureNotFoundException uses the HRESULT COR_E_ARGUMENT, which has the value 0x80070057.
Construtores
CultureNotFoundException() |
Inicializa uma nova instância da classe CultureNotFoundException com sua cadeia de caracteres de mensagem definida como uma mensagem fornecida pelo sistema.Initializes a new instance of the CultureNotFoundException class with its message string set to a system-supplied message. |
CultureNotFoundException(SerializationInfo, StreamingContext) |
Inicializa uma nova instância da classe CultureNotFoundException usando o contexto e os dados de serialização especificados.Initializes a new instance of the CultureNotFoundException class using the specified serialization data and context. |
CultureNotFoundException(String) |
Inicializa uma nova instância da classe CultureNotFoundException com a mensagem de erro especificada.Initializes a new instance of the CultureNotFoundException class with the specified error message. |
CultureNotFoundException(String, Exception) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message and a reference to the inner exception that is the cause of this exception. |
CultureNotFoundException(String, Int32, Exception) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada, a ID de Cultura inválida e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message, the invalid Culture ID, and a reference to the inner exception that is the cause of this exception. |
CultureNotFoundException(String, Int32, String) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada, a ID de Cultura inválida e o nome do parâmetro que é a causa dessa exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message, the invalid Culture ID, and the name of the parameter that is the cause this exception. |
CultureNotFoundException(String, String) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada e o nome do parâmetro que é a causa dessa exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message and the name of the parameter that is the cause this exception. |
CultureNotFoundException(String, String, Exception) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada, o Nome de Cultura inválido e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message, the invalid Culture Name, and a reference to the inner exception that is the cause of this exception. |
CultureNotFoundException(String, String, String) |
Inicializa uma nova instância da classe CultureNotFoundException com uma mensagem de erro especificada, o Nome de Cultura inválido e o nome do parâmetro que é a causa dessa exceção.Initializes a new instance of the CultureNotFoundException class with a specified error message, the invalid Culture Name, and the name of the parameter that is the cause this exception. |
Propriedades
Data |
Obtém uma coleção de pares de chave/valor que fornecem informações definidas pelo usuário adicionais sobre a exceção.Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Herdado de Exception) |
HelpLink |
Obtém ou define um link para o arquivo de ajuda associado a essa exceção.Gets or sets a link to the help file associated with this exception. (Herdado de Exception) |
HResult |
Obtém ou define HRESULT, um valor numérico codificado que é atribuído a uma exceção específica.Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Herdado de Exception) |
InnerException |
Obtém a instância Exception que causou a exceção atual.Gets the Exception instance that caused the current exception. (Herdado de Exception) |
InvalidCultureId |
Obtém o identificador de cultura que não pode ser encontrado.Gets the culture identifier that cannot be found. |
InvalidCultureName |
Obtém o nome de cultura que não pode ser encontrado.Gets the culture name that cannot be found. |
Message |
Obtém a mensagem de erro que explica a razão da exceção.Gets the error message that explains the reason for the exception. |
ParamName |
Obtém o nome do parâmetro que causa essa exceção.Gets the name of the parameter that causes this exception. (Herdado de ArgumentException) |
Source |
Obtém ou define o nome do aplicativo ou objeto que causa o erro.Gets or sets the name of the application or the object that causes the error. (Herdado de Exception) |
StackTrace |
Obtém uma representação de cadeia de caracteres de quadros imediatos na pilha de chamadas.Gets a string representation of the immediate frames on the call stack. (Herdado de Exception) |
TargetSite |
Obtém o método que gerou a exceção atual.Gets the method that throws the current exception. (Herdado de Exception) |
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) |
GetBaseException() |
Quando substituído em uma classe derivada, retorna a Exception que é a causa raiz de uma ou mais exceções subsequentes.When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Herdado de Exception) |
GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
GetObjectData(SerializationInfo, StreamingContext) |
Define o objeto SerializationInfo com o nome do parâmetro e informações adicionais de exceção.Sets the SerializationInfo object with the parameter name and additional exception information. |
GetObjectData(SerializationInfo, StreamingContext) |
Define o objeto SerializationInfo com o nome do parâmetro e informações adicionais de exceção.Sets the SerializationInfo object with the parameter name and additional exception information. (Herdado de ArgumentException) |
GetType() |
Obtém o tipo de runtime da instância atual.Gets the runtime type of the current instance. (Herdado de Exception) |
MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
ToString() |
Cria e retorna uma representação de cadeia de caracteres da exceção atual.Creates and returns a string representation of the current exception. (Herdado de Exception) |
Eventos
SerializeObjectState |
Ocorre quando uma exceção é serializada para criar um objeto de estado de exceção que contém dados serializados sobre a exceção.Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Herdado de Exception) |