本文整理汇总了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);
}
}
}
示例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();
}
}
}
}
示例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();
}
}
}
}
示例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();
}
}
}