IMessageFormatter 介面

定義

序列化或還原序列化訊息佇列訊息主體中的物件。

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 實例將訊息傳送至佇列時,格式器會將物件串行化 (可以是任何類別的實例,) 到數據流中,並將它插入訊息本文。 使用 MessageQueue從佇列讀取時,格式子會將訊息數據還原串行化為 BodyMessage屬性。

BinaryMessageFormatterActiveXMessageFormatter 提供比 更快的 XmlMessageFormatter輸送量。 ActiveXMessageFormatter允許與 Visual Basic 6.0 消息佇列應用程式互操作性。 XmlMessageFormatter鬆散結合,這表示伺服器和用戶端可以獨立設定傳送和接收的類型版本。

方法

CanRead(Message)

在類別內實作時,決定格式子是否可以將訊息的內容還原序列化。

Clone()

建立目前執行個體複本的新物件。

(繼承來源 ICloneable)
Read(Message)

在類別內實作時,讀取指定訊息的內容,並建立含有訊息資料的物件。

Write(Message, Object)

在類別內實作時,將物件序列化到訊息主體中。

適用於

另請參閱