ThreadStateException Construtores
Definição
Inicializa uma nova instância da classe ThreadStateException.Initializes a new instance of the ThreadStateException class.
Sobrecargas
ThreadStateException() |
Inicializa uma nova instância da classe ThreadStateException com propriedades padrão.Initializes a new instance of the ThreadStateException class with default properties. |
ThreadStateException(String) |
Inicializa uma nova instância da classe ThreadStateException com uma mensagem de erro especificada.Initializes a new instance of the ThreadStateException class with a specified error message. |
ThreadStateException(SerializationInfo, StreamingContext) |
Inicializa uma nova instância da classe ThreadStateException com dados serializados.Initializes a new instance of the ThreadStateException class with serialized data. |
ThreadStateException(String, Exception) |
Inicializa uma nova instância da classe ThreadStateException 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 ThreadStateException class with a specified error message and a reference to the inner exception that is the cause of this exception. |
ThreadStateException()
Inicializa uma nova instância da classe ThreadStateException com propriedades padrão.Initializes a new instance of the ThreadStateException class with default properties.
public:
ThreadStateException();
public ThreadStateException ();
Public Sub New ()
Comentários
Esse construtor inicializa a Message
propriedade da nova instância para uma mensagem fornecida pelo sistema que descreve o erro, como "a operação solicitada não pode ser executada no thread devido a seu estado atual."This constructor initializes the Message
property of the new instance to a system-supplied message that describes the error, such as "The requested operation cannot be performed on the thread due to its current state." Essa mensagem considera a cultura do sistema atual.This message takes into account the current system culture.
A tabela a seguir mostra os valores de propriedade inicial de uma instância de ThreadStateException.The following table shows the initial property values for an instance of ThreadStateException.
PropriedadeProperty | ValorValue |
---|---|
InnerException | null .null . |
Message | A cadeia de caracteres da mensagem de erro localizada.The localized error message string. |
Aplica-se a
ThreadStateException(String)
Inicializa uma nova instância da classe ThreadStateException com uma mensagem de erro especificada.Initializes a new instance of the ThreadStateException class with a specified error message.
public:
ThreadStateException(System::String ^ message);
public ThreadStateException (string message);
new System.Threading.ThreadStateException : string -> System.Threading.ThreadStateException
Public Sub New (message As String)
Parâmetros
- message
- String
A mensagem de erro que explica a razão da exceção.The error message that explains the reason for the exception.
Comentários
Esse construtor inicializa a Message
propriedade da nova instância usando o message
parâmetro.This constructor initializes the Message
property of the new instance using the message
parameter.
A tabela a seguir mostra os valores de propriedade inicial de uma instância de ThreadStateException.The following table shows the initial property values for an instance of ThreadStateException.
PropriedadeProperty | ValorValue |
---|---|
InnerException | null .null . |
Message | A cadeia de caracteres da mensagem de erro.The error message string. |
Aplica-se a
ThreadStateException(SerializationInfo, StreamingContext)
Inicializa uma nova instância da classe ThreadStateException com dados serializados.Initializes a new instance of the ThreadStateException class with serialized data.
protected:
ThreadStateException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected ThreadStateException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Threading.ThreadStateException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Threading.ThreadStateException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Parâmetros
- info
- SerializationInfo
O SerializationInfo que mantém os dados de objeto serializados sobre a exceção que está sendo lançada.The SerializationInfo that holds the serialized object data about the exception being thrown.
- context
- StreamingContext
O StreamingContext que contém informações contextuais sobre a fonte ou o destino.The StreamingContext that contains contextual information about the source or destination.
Comentários
O construtor é chamado durante a desserialização para reconstituir o objeto de exceção transmitido em um fluxo.This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. Para obter mais informações, consulte serialização XML e SOAP.For more information, see XML and SOAP Serialization.
Confira também
Aplica-se a
ThreadStateException(String, Exception)
Inicializa uma nova instância da classe ThreadStateException 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 ThreadStateException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public:
ThreadStateException(System::String ^ message, Exception ^ innerException);
public ThreadStateException (string message, Exception innerException);
new System.Threading.ThreadStateException : string * Exception -> System.Threading.ThreadStateException
Public Sub New (message As String, innerException As Exception)
Parâmetros
- message
- String
A mensagem de erro que explica a razão da exceção.The error message that explains the reason for the exception.
- innerException
- Exception
A exceção que é a causa da exceção atual.The exception that is the cause of the current exception. Caso o parâmetro innerException
não seja null
, a exceção atual é acionada em um bloco catch
que identifica a exceção interna.If the innerException
parameter is not null
, the current exception is raised in a catch
block that handles the inner exception.
Comentários
Uma exceção que é lançada como um resultado direto de uma exceção anterior deve incluir uma referência para a exceção anterior na propriedade InnerException.An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. A propriedade InnerException retorna o mesmo valor passado ao construtor, ou null
se a propriedade InnerException não fornecer o valor da exceção interna ao construtor.The InnerException property returns the same value that is passed into the constructor, or null
if the InnerException property does not supply the inner exception value to the constructor.
A tabela a seguir mostra os valores de propriedade inicial de uma instância de ThreadStateException.The following table shows the initial property values for an instance of ThreadStateException.
PropriedadeProperty | ValorValue |
---|---|
InnerException | A referência de exceção interna.The inner exception reference. |
Message | A cadeia de caracteres da mensagem de erro.The error message string. |