XmlMessageFormatter.TargetTypeNames Propriedade
Definição
Especifica o conjunto de tipos possíveis que serão desserializados pelo formatador da mensagem fornecida.Specifies the set of possible types that will be deserialized by the formatter from the message provided.
public:
property cli::array <System::String ^> ^ TargetTypeNames { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
[System.Messaging.MessagingDescription("XmlMsgTargetTypeNames")]
public string[] TargetTypeNames { get; set; }
[<System.Messaging.MessagingDescription("XmlMsgTargetTypeNames")>]
member this.TargetTypeNames : string[] with get, set
Public Property TargetTypeNames As String()
Valor da propriedade
- String[]
Uma matriz do tipo String que especifica os tipos de objetos a serem desserializados do corpo da mensagem ao ler a mensagem.An array of type String that specifies the types of objects to deserialize from the message body when reading the message.
- Atributos
Exceções
A propriedade TargetTypeNames é null.The TargetTypeNames property is null.
Comentários
As TargetTypeNames Propriedades e TargetTypes dizem ao formatador quais esquemas tentar corresponder ao desserializar uma mensagem.Both the TargetTypeNames and TargetTypes properties tell the formatter what schemas to attempt to match when deserializing a message. Isso permite que o formatador interprete o corpo da mensagem.This allows the formatter to interpret the message body.
A instância serializada no corpo da mensagem deve estar em conformidade com um dos esquemas representados na matriz de tipos.The instance serialized in the message body must comply with one of the schemas represented in the type array. Quando você lê a mensagem usando o Receive método, o método cria um objeto do tipo que corresponde ao esquema identificado e lê o corpo da mensagem nele.When you read the message using the Receive method, the method creates an object of the type that corresponds to the schema identified and reads the message body into it.
Somente uma das duas propriedades precisa ser definida durante a leitura da fila, mas você pode definir ambas.Only one of the two properties needs to be set when reading from the queue, but you can set both. O conjunto de tipos é o conjunto combinado das duas propriedades.The set of types is the combined set from the two properties. A decisão de qual propriedade usar é específica para seu aplicativo.The decision of which property to use is specific to your application. Se o corpo da mensagem contiver um tipo cujo esquema não corresponde a nenhum dos tipos na matriz para qualquer propriedade, uma exceção será lançada quando a mensagem for lida.If the message body contains a type whose schema does not match any of the types in the array for either property, an exception will be thrown when the message is read.
TargetTypeNames requer que cada entrada seja totalmente qualificada, especificando seu nome de assembly.TargetTypeNames requires every entry to be fully qualified, specifying its assembly name. Além disso, ao trabalhar com várias versões simultâneas, o número de versão também deve ser anexado ao nome do tipo de destino.Further, when working with multiple concurrent versions, the version number must also be appended to the target type name as well.
Os tipos de destino são necessários apenas ao ler da fila.The target types are only required when reading from the queue. As TargetTypeNames TargetTypes Propriedades e não precisam ser definidas para gravar na fila.The TargetTypeNames and TargetTypes properties do not need to be set to write to the queue.