MessagePropertyFilter.DefaultExtensionSize 属性

定义

获取或设置默认扩展缓冲区的大小(以字节为单位)。

public:
 property int DefaultExtensionSize { int get(); void set(int value); };
[System.Messaging.MessagingDescription("MsgDefaultExtensionSize")]
public int DefaultExtensionSize { get; set; }
[<System.Messaging.MessagingDescription("MsgDefaultExtensionSize")>]
member this.DefaultExtensionSize : int with get, set
Public Property DefaultExtensionSize As Integer

属性值

Int32

接收消息时创建的默认扩展缓冲区大小。 默认值为 255 字节。

属性

例外

分配的值为负。

示例

下面的代码示例演示了该 DefaultExtensionSize 属性的使用。

// Set the filter's DefaultExtensionSize
// property to 1024 bytes.
queue->MessageReadPropertyFilter->
    DefaultExtensionSize = 1024;

// Display the new value of the filter's 
// DefaultExtensionSize property.
Console::WriteLine(
    "MessageReadPropertyFilter."
    "DefaultExtensionSize: {0}", 
    queue->MessageReadPropertyFilter->
    DefaultExtensionSize);
// Set the filter's DefaultExtensionSize property to 1024 bytes.
queue.MessageReadPropertyFilter.DefaultExtensionSize = 1024;

// Display the new value of the filter's DefaultExtensionSize property.
Console.WriteLine("MessageReadPropertyFilter.DefaultExtensionSize: {0}",
    queue.MessageReadPropertyFilter.DefaultExtensionSize.ToString());

注解

默认扩展大小指定要为消息的扩展分配的字节数。 Extension类的属性Message表示与消息关联的附加应用程序定义信息,例如二进制大型对象。 It is the responsibility of the application to interpret the contents of the Extension.

适用于

另请参阅