MessagePropertyFilter.IsLastInTransaction 属性

定义

获取或设置一个值,该值指示接收或查看消息时是否检索 IsLastInTransaction 属性信息。Gets or sets a value that indicates whether to retrieve IsLastInTransaction property information when receiving or peeking a message.

public:
 property bool IsLastInTransaction { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgIsLastInTransaction")]
public bool IsLastInTransaction { get; set; }
[<System.Messaging.MessagingDescription("MsgIsLastInTransaction")>]
member this.IsLastInTransaction : bool with get, set
Public Property IsLastInTransaction As Boolean

属性值

Boolean

如果接收 IsLastInTransaction 信息,则为 true;否则为 falsetrue to receive IsLastInTransaction information; otherwise, false. 默认值为 falseThe default is false.

属性

示例

下面的代码示例演示属性的用法 IsLastInTransactionThe following code example demonstrates the use of the IsLastInTransaction property.

// Set the queue's MessageReadPropertyFilter property 
// to enable the message's IsLastInTransaction property.
queue->MessageReadPropertyFilter->
    IsLastInTransaction = true;

// Peek at the message. Time out after ten seconds 
// in case the message was not delivered.
orderMessage = queue->Peek(TimeSpan::FromSeconds(10.0));

// Display the value of the message's 
// IsLastInTransaction property.
Console::WriteLine("Message.IsLastInTransaction: {0}", 
    orderMessage->IsLastInTransaction);

// Set the queue's MessageReadPropertyFilter property to enable the
// message's IsLastInTransaction property.
queue.MessageReadPropertyFilter.IsLastInTransaction = true;

// Peek at the message. Time out after ten seconds in case the message
// was not delivered.
orderMessage = queue.Peek(TimeSpan.FromSeconds(10.0));

// Display the value of the message's IsLastInTransaction property.
Console.WriteLine("Message.IsLastInTransaction: {0}",
    orderMessage.IsLastInTransaction);

注解

IsLastInTransaction Message 接收应用程序使用类的属性来验证消息是否是从单个事务发送到单个队列的最后一条消息。The IsLastInTransaction property of the Message class is used by receiving applications to verify whether a message is the last message sent from a single transaction to a single queue.

适用于

另请参阅