当前位置: 首页>>代码示例>>C#>>正文


C# ActivityExecutor.TryGetPendingOperation方法代码示例

本文整理汇总了C#中ActivityExecutor.TryGetPendingOperation方法的典型用法代码示例。如果您正苦于以下问题:C# ActivityExecutor.TryGetPendingOperation方法的具体用法?C# ActivityExecutor.TryGetPendingOperation怎么用?C# ActivityExecutor.TryGetPendingOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActivityExecutor的用法示例。


在下文中一共展示了ActivityExecutor.TryGetPendingOperation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InternalCancel

 internal sealed override void InternalCancel(System.Activities.ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
 {
     AsyncOperationContext context;
     if (executor.TryGetPendingOperation(instance, out context))
     {
         using (AsyncCodeActivityContext context2 = new AsyncCodeActivityContext(context, instance, executor))
         {
             context.HasCalledAsyncCodeActivityCancel = true;
             this.Cancel(context2);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:AsyncCodeActivity.cs

示例2: InternalAbort

 internal sealed override void InternalAbort(System.Activities.ActivityInstance instance, ActivityExecutor executor, Exception terminationReason)
 {
     AsyncOperationContext context;
     if (executor.TryGetPendingOperation(instance, out context))
     {
         try
         {
             if (!context.HasCalledAsyncCodeActivityCancel)
             {
                 context.IsAborting = true;
                 this.InternalCancel(instance, executor, null);
             }
         }
         finally
         {
             if (context.IsStillActive)
             {
                 context.CancelOperation();
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:AsyncCodeActivity.cs

示例3: InternalAbort

 sealed internal override void InternalAbort(ActivityInstance instance, ActivityExecutor executor, Exception terminationReason)
 {
     AsyncOperationContext asyncContext;
     if (executor.TryGetPendingOperation(instance, out asyncContext))
     {
         try
         {
             if (!asyncContext.HasCalledAsyncCodeActivityCancel)
             {
                 asyncContext.IsAborting = true;
                 InternalCancel(instance, executor, null);
             }
         }
         finally
         {
             // we should always abort outstanding contexts
             if (asyncContext.IsStillActive)
             {
                 asyncContext.CancelOperation();
             }
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:23,代码来源:AsyncCodeActivity.cs

示例4: InternalCancel

 sealed internal override void InternalCancel(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
 {
     AsyncOperationContext asyncContext;
     if (executor.TryGetPendingOperation(instance, out asyncContext))
     {
         AsyncCodeActivityContext context = new AsyncCodeActivityContext(asyncContext, instance, executor);
         try
         {
             asyncContext.HasCalledAsyncCodeActivityCancel = true;
             Cancel(context);
         }
         finally
         {
             context.Dispose();
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:AsyncCodeActivity.cs


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