MessagePropertyFilter.IsLastInTransaction 属性

定义

获取或设置一个值,该值指示接收或查看消息时是否检索 IsLastInTransaction 属性信息。

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

属性值

如果接收 IsLastInTransaction 信息,则为 true;否则为 false。 默认值为 false

属性

示例

下面的代码示例演示如何使用 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);
// 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 属性来验证消息是否是从单个事务发送到单个队列的最后一条消息。

适用于

另请参阅