本文整理汇总了C#中System.Transactions.Transaction.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.Clone方法的具体用法?C# Transaction.Clone怎么用?C# Transaction.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.Transaction
的用法示例。
在下文中一共展示了Transaction.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransactionContext
public TransactionContext(WorkflowServiceInstance durableInstance, Transaction currentTransaction)
{
Fx.Assert(durableInstance != null, "Null DurableInstance passed to TransactionContext.");
Fx.Assert(currentTransaction != null, "Null Transaction passed to TransactionContext.");
this.currentTransaction = currentTransaction.Clone();
this.durableInstance = durableInstance;
this.currentTransaction.EnlistVolatile(this, EnlistmentOptions.EnlistDuringPrepareRequired);
}
示例2: InstancePersistenceContext
internal InstancePersistenceContext(InstanceHandle handle, Transaction transaction)
: this(handle)
{
Fx.Assert(transaction != null, "Null Transaction passed to InstancePersistenceContext.");
// Let's take our own clone of the transaction. We need to do this because we might need to
// create a TransactionScope using the transaction and in cases where we are dealing with a
// transaction that is flowed into the workflow on a message, the DependentTransaction that the
// dispatcher creates and sets to Transaction.Current may already be Completed by the time a
// Save operation is done. And since TransactionScope creates a DependentTransaction, it won't
// be able to.
// We don't create another DependentClone because we are going to do a EnlistVolatile on the
// transaction ourselves.
this.transaction = transaction.Clone();
IsHostTransaction = true;
this.eventTraceActivity = handle.EventTraceActivity;
}
示例3: TransactedRegistryKey
private TransactedRegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, Transaction transaction, SafeTransactionHandle txHandle)
{
this.hkey = hkey;
this.keyName = "";
if (systemkey)
{
this.state |= 2;
}
if (writable)
{
this.state |= 4;
}
if (null != transaction)
{
this.myTransaction = transaction.Clone();
this.myTransactionHandle = txHandle;
}
else
{
this.myTransaction = null;
this.myTransactionHandle = null;
}
}
示例4: TransactionContext
public TransactionContext(WorkflowServiceInstance durableInstance, Transaction currentTransaction)
{
this.currentTransaction = currentTransaction.Clone();
this.durableInstance = durableInstance;
this.currentTransaction.EnlistVolatile(this, EnlistmentOptions.EnlistDuringPrepareRequired);
}