IMessageFormatter Интерфейс
Определение
Сериализует объекты в текст сообщения Message Queuing или десериализует объекты из этого текста.Serializes or deserializes objects from the body of a Message Queuing message.
public interface class IMessageFormatter : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.MessageFormatterConverter))]
public interface IMessageFormatter : ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.MessageFormatterConverter))>]
type IMessageFormatter = interface
interface ICloneable
Public Interface IMessageFormatter
Implements ICloneable
- Производный
- Атрибуты
- Реализации
Комментарии
Когда приложение отправляет сообщение в очередь с помощью экземпляра MessageQueue класса, модуль форматирования сериализует объект (который может быть экземпляром любого класса) в поток и вставляет его в текст сообщения.When an application sends a message to the queue using an instance of the MessageQueue class, the formatter serializes the object (which can be an instance of any class) into a stream and inserts it into the message body. При чтении из очереди с помощью MessageQueue модуль форматирования десериализует данные сообщения в Body свойство объекта Message .When reading from a queue using a MessageQueue, the formatter deserializes the message data into the Body property of a Message.
BinaryMessageFormatter и ActiveXMessageFormatter обеспечивают более высокую пропускную способность, чем XmlMessageFormatter .BinaryMessageFormatter and ActiveXMessageFormatter provide faster throughput than the XmlMessageFormatter. ActiveXMessageFormatterКомпонент обеспечивает взаимодействие с приложениями очереди сообщений Visual Basic 6,0.The ActiveXMessageFormatter allows interoperability with Visual Basic 6.0 Message Queuing applications. Объект XmlMessageFormatter является слабо связанным. Это означает, что сервер и клиент могут выполнять версию типа, который отправляется и получается независимо.The XmlMessageFormatter is loosely coupled, which means that the server and client can version the type that is sent and received independently.
Методы
CanRead(Message) |
При реализации в классе определяет, может ли модуль форматирования десериализовать содержимое данного сообщения.When implemented in a class, determines whether the formatter can deserialize the contents of the message. |
Clone() |
Создает новый объект, являющийся копией текущего экземпляра.Creates a new object that is a copy of the current instance. (Унаследовано от ICloneable) |
Read(Message) |
При реализации в классе читает содержимое заданного сообщения и создает объект, содержащий данные из этого сообщения.When implemented in a class, reads the contents from the given message and creates an object that contains data from the message. |
Write(Message, Object) |
При реализации в классе сериализует объект в текст сообщения.When implemented in a class, serializes an object into the body of the message. |