MessagePropertyFilter.IsFirstInTransaction 属性

定义

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

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

属性值

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

属性

示例

下面的代码示例演示如何使用 IsFirstInTransaction 属性。

// Set the queue's MessageReadPropertyFilter property 
// to enable the message's IsFirstInTransaction property.
queue->MessageReadPropertyFilter->
    IsFirstInTransaction = 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 
// IsFirstInTransaction property.
Console::WriteLine("Message.IsFirstInTransaction: {0}", 
    orderMessage->IsFirstInTransaction);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's IsFirstInTransaction property.
queue.MessageReadPropertyFilter.IsFirstInTransaction = 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 IsFirstInTransaction property.
Console.WriteLine("Message.IsFirstInTransaction: {0}",
    orderMessage.IsFirstInTransaction);

注解

IsFirstInTransaction接收应用程序使用 类的 Message 属性来验证消息是否是单个事务中发送到单个队列的第一条消息。

适用于

另请参阅