TransactionEventArgs 类

定义

为下面的事务事件提供数据:DistributedTransactionStartedTransactionCompletedProvides data for the following transaction events: DistributedTransactionStarted, TransactionCompleted.

public ref class TransactionEventArgs : EventArgs
public class TransactionEventArgs : EventArgs
type TransactionEventArgs = class
    inherit EventArgs
Public Class TransactionEventArgs
Inherits EventArgs
继承
TransactionEventArgs

示例

下面的示例演示如何使用此类型。The following example demonstrates how this type is used.

//Transaction completed event handler
static void Current_TransactionCompleted(object sender, TransactionEventArgs e)
{

   Console.WriteLine("A transaction has completed:");
   Console.WriteLine("ID:{0}",   e.Transaction.TransactionInformation.LocalIdentifier);
   Console.WriteLine("Distributed ID: {0}", e.Transaction.TransactionInformation.DistributedIdentifier);
   Console.WriteLine("Status:         {0}", e.Transaction.TransactionInformation.Status);
   Console.WriteLine("IsolationLevel: {0}", e.Transaction.IsolationLevel);
}

构造函数

TransactionEventArgs()

初始化 TransactionEventArgs 类的新实例。Initializes a new instance of the TransactionEventArgs class.

属性

Transaction

获取为其提供事件状态的事务。Gets the transaction for which event status is provided.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于