• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IEnlistmentNotification类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IEnlistmentNotification的典型用法代码示例。如果您正苦于以下问题:C# IEnlistmentNotification类的具体用法?C# IEnlistmentNotification怎么用?C# IEnlistmentNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IEnlistmentNotification类属于命名空间,在下文中一共展示了IEnlistmentNotification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EnlistVolatile

		/// <summary>
		/// Enlists a resource manager in this transaction.
		/// </summary>
		/// <param name="p_entNotification">The resource manager to enlist.</param>
		/// <param name="p_eopOptions">The enlistment options. This value must be <see cref="EnlistmentOptions.None"/>.</param>
		/// <exception cref="ArgumentException">Thrown if <paramref name="p_eopOptions"/> is not
		/// <see cref="EnlistmentOptions.None"/>.</exception>
		public void EnlistVolatile(IEnlistmentNotification p_entResourceManager, EnlistmentOptions p_eopOptions)
		{
			if (p_eopOptions != EnlistmentOptions.None)
				throw new ArgumentException("EnlistmentOptions must be None.", "p_eopOptions");

			m_lstNotifications.Add(p_entResourceManager);
		}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:14,代码来源:Transaction.cs


示例2: InternalEnlistment

 internal InternalEnlistment(System.Transactions.Enlistment enlistment, IEnlistmentNotification twoPhaseNotifications, InternalTransaction transaction, System.Transactions.Transaction atomicTransaction)
 {
     this.enlistment = enlistment;
     this.twoPhaseNotifications = twoPhaseNotifications;
     this.transaction = transaction;
     this.atomicTransaction = atomicTransaction;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:InternalEnlistment.cs


示例3: TestInitialize

        public void TestInitialize()
        {
            target = new TransactionEnlistmentHelper();

            ensureTransaction = true;
            options = EnlistmentOptions.None;

            enlistmentNotification = MockRepository.GenerateMock<IEnlistmentNotification>();
            enlistmentNotification.Expect( en => en.Prepare( null ) )
                .IgnoreArguments()
                .WhenCalled( a =>
                {
                    PreparingEnlistment e = a.Arguments.GetValue( 0 ) as PreparingEnlistment;
                    e.Prepared();
                } )
                .Repeat.Once();

            enlistmentNotification.Expect( en => en.Commit( null ) )
                .IgnoreArguments()
                .WhenCalled( a =>
                {
                    Enlistment e = a.Arguments.GetValue( 0 ) as Enlistment;
                    e.Done();
                } )
                .Repeat.Once();
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:26,代码来源:TransactionEnlistmentHelperEventsTest.cs


示例4: InternalEnlistment

 // For Recovering Enlistments
 protected InternalEnlistment(
     Enlistment enlistment,
     IEnlistmentNotification twoPhaseNotifications
     )
 {
     Debug.Assert(this is RecoveringInternalEnlistment, "this is RecoveringInternalEnlistment");
     this.enlistment = enlistment;
     this.twoPhaseNotifications = twoPhaseNotifications;
     this.enlistmentId = 1;
     this.traceIdentifier = EnlistmentTraceIdentifier.Empty;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:Enlistment.cs


示例5: Enlistment

 internal Enlistment(InternalTransaction transaction, IEnlistmentNotification twoPhaseNotifications, ISinglePhaseNotification singlePhaseNotifications, Transaction atomicTransaction, EnlistmentOptions enlistmentOptions)
 {
     if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
     {
         this.internalEnlistment = new System.Transactions.InternalEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
     }
     else
     {
         this.internalEnlistment = new Phase1VolatileEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:Enlistment.cs


示例6: Enlistment

 internal Enlistment(
     Guid resourceManagerIdentifier,
     InternalTransaction transaction,
     IEnlistmentNotification twoPhaseNotifications,
     ISinglePhaseNotification singlePhaseNotifications,
     Transaction atomicTransaction)
 {
     _internalEnlistment = new DurableInternalEnlistment(
         this,
         resourceManagerIdentifier,
         transaction,
         twoPhaseNotifications,
         singlePhaseNotifications,
         atomicTransaction
         );
 }
开发者ID:dotnet,项目名称:corefx,代码行数:16,代码来源:Enlistment.cs


示例7: EnlistVolatile

 internal override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     Enlistment enlistment = new Enlistment(tx, enlistmentNotification, null, atomicTransaction, enlistmentOptions);
     if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
     {
         base.AddVolatileEnlistment(ref tx.phase0Volatiles, enlistment);
     }
     else
     {
         base.AddVolatileEnlistment(ref tx.phase1Volatiles, enlistment);
     }
     if (DiagnosticTrace.Information)
     {
         EnlistmentTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
     }
     return enlistment;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:TransactionStatePhase0.cs


示例8: EnlistVolatile

 public Enlistment EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
 {
 }
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:3,代码来源:SubordinateTransaction.cs


示例9: EnlistVolatile

 internal virtual Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
 {
     throw TransactionException.CreateTransactionStateException(System.Transactions.SR.GetString("TraceSourceLtm"), tx.innerException);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionState.cs


示例10: EnlistDurable

 public Enlistment EnlistDurable(System.Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
 {
 }
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:3,代码来源:SubordinateTransaction.cs


示例11: Enlistment

 internal Enlistment(
     IEnlistmentNotification twoPhaseNotifications,
     object syncRoot
     )
 {
     this.internalEnlistment = new RecoveringInternalEnlistment(
         this,
         twoPhaseNotifications,
         syncRoot
         );
 }
开发者ID:mind0n,项目名称:hive,代码行数:11,代码来源:Enlistment.cs


示例12: PreparingEnlistment

		internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
		{
			this.tx = tx;
			this.enlisted = enlisted;
			waitHandle = new ManualResetEvent (false);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:6,代码来源:PreparingEnlistment.cs


示例13: EnlistVolatileInternal

		private Enlistment EnlistVolatileInternal (
			IEnlistmentNotification notification,
			EnlistmentOptions options)
		{
			EnsureIncompleteCurrentScope (); 
			/* FIXME: Handle options.EnlistDuringPrepareRequired */
			Volatiles.Add (notification);

			/* FIXME: Enlistment.. ? */
			return new Enlistment ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:Transaction.cs


示例14: Rollback

		internal void Rollback (Exception ex, IEnlistmentNotification enlisted)
		{
			if (aborted)
				return;

			/* See test ExplicitTransaction7 */
			if (info.Status == TransactionStatus.Committed)
				throw new TransactionException ("Transaction has already been committed. Cannot accept any new work.");

			innerException = ex;
			Enlistment e = new Enlistment ();
			foreach (IEnlistmentNotification prep in volatiles)
				if (prep != enlisted)
					prep.Rollback (e);

			if (durables.Count > 0 && durables [0] != enlisted)
				durables [0].Rollback (e);

			Aborted = true;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:20,代码来源:Transaction.cs


示例15: DurableInternalEnlistment

 protected DurableInternalEnlistment(
     Enlistment enlistment,
     IEnlistmentNotification twoPhaseNotifications
     ) : base(enlistment, twoPhaseNotifications)
 {
 }
开发者ID:mind0n,项目名称:hive,代码行数:6,代码来源:Enlistment.cs


示例16: RecoveringInternalEnlistment

 internal RecoveringInternalEnlistment(
     Enlistment enlistment,
     IEnlistmentNotification twoPhaseNotifications,
     object syncRoot
     ) : base(enlistment, twoPhaseNotifications)
 {
     this.syncRoot = syncRoot;
 }
开发者ID:mind0n,项目名称:hive,代码行数:8,代码来源:Enlistment.cs


示例17: EnlistVolatile

 internal override Enlistment EnlistVolatile(
    InternalTransaction tx,
    IEnlistmentNotification enlistmentNotification,
    EnlistmentOptions enlistmentOptions,
    Transaction atomicTransaction
    )
 {
     throw TransactionException.Create(SR.TooLate, tx == null ? Guid.Empty : tx.DistributedTxId);
 }
开发者ID:hughbe,项目名称:corefx,代码行数:9,代码来源:TransactionState.cs


示例18: EnlistDurable

 internal virtual Enlistment EnlistDurable(
     InternalTransaction tx,
     Guid resourceManagerIdentifier,
     IEnlistmentNotification enlistmentNotification,
     EnlistmentOptions enlistmentOptions,
     Transaction atomicTransaction
     )
 {
     throw TransactionException.CreateTransactionStateException(tx._innerException, tx.DistributedTxId);
 }
开发者ID:hughbe,项目名称:corefx,代码行数:10,代码来源:TransactionState.cs


示例19: EnlistVolatile

        // Forward request to the state machine to take the appropriate action.
        //
        /// <include file='doc\Transaction' path='docs/doc[@for="Transaction.EnlistVolatile"]/*' />
        public Enlistment EnlistVolatile(
            IEnlistmentNotification enlistmentNotification,
            EnlistmentOptions enlistmentOptions
            )
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(SR.GetString(SR.TraceSourceLtm),
                    "Transaction.EnlistVolatile( IEnlistmentNotification )"
                    );
            }

            if (Disposed)
            {
                throw new ObjectDisposedException("Transaction");
            }

            if (enlistmentNotification == null)
            {
                throw new ArgumentNullException("enlistmentNotification");
            }

            if (enlistmentOptions != EnlistmentOptions.None && enlistmentOptions != EnlistmentOptions.EnlistDuringPrepareRequired)
            {
                throw new ArgumentOutOfRangeException("enlistmentOptions");
            }

            if (this.complete)
            {
                throw TransactionException.CreateTransactionCompletedException(SR.GetString(SR.TraceSourceLtm));
            }

            lock (this.internalTransaction)
            {
                Enlistment enlistment = this.internalTransaction.State.EnlistVolatile(this.internalTransaction,
                    enlistmentNotification, enlistmentOptions, this);

                if (DiagnosticTrace.Verbose)
                {
                    MethodExitedTraceRecord.Trace(SR.GetString(SR.TraceSourceLtm),
                        "Transaction.EnlistVolatile( IEnlistmentNotification )"
                        );
                }
                return enlistment;
            }
        }
开发者ID:salim18,项目名称:DemoProject2,代码行数:49,代码来源:Transaction.cs


示例20: EnlistDurable

		public Enlistment EnlistDurable (Guid manager,
			IEnlistmentNotification notification,
			EnlistmentOptions options)
		{
			throw new NotImplementedException ("DTC unsupported, only SinglePhase commit supported for durable resource managers.");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:6,代码来源:Transaction.cs



注:本文中的IEnlistmentNotification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IEntitiesContext类代码示例发布时间:2022-05-24
下一篇:
C# IEngineContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap