本文整理汇总了C#中ActivityExecutor类的典型用法代码示例。如果您正苦于以下问题:C# ActivityExecutor类的具体用法?C# ActivityExecutor怎么用?C# ActivityExecutor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActivityExecutor类属于命名空间,在下文中一共展示了ActivityExecutor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InternalAbort
internal override void InternalAbort(System.Activities.ActivityInstance instance, ActivityExecutor executor, Exception terminationReason)
{
using (NativeActivityAbortContext context = new NativeActivityAbortContext(instance, executor, terminationReason))
{
this.Abort(context);
}
}
示例2: WorkflowDataContext
internal WorkflowDataContext(ActivityExecutor executor, ActivityInstance activityInstance, bool includeLocalVariables)
{
this.executor = executor;
this.activityInstance = activityInstance;
this.IncludesLocalVariables = includeLocalVariables;
this.properties = CreateProperties();
}
示例3: InternalExecute
internal override void InternalExecute(System.Activities.ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
{
if (this.runtimeImplementation != null)
{
executor.ScheduleActivity(this.runtimeImplementation, instance, null, null, null);
}
}
示例4: InternalExecute
internal sealed override void InternalExecute(System.Activities.ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
{
AsyncOperationContext asyncContext = executor.SetupAsyncOperationBlock(instance);
instance.IncrementBusyCount();
AsyncCodeActivityContext context = new AsyncCodeActivityContext(asyncContext, instance, executor);
bool flag = false;
try
{
IAsyncResult result = this.BeginExecute(context, OnExecuteComplete, asyncContext);
if (result == null)
{
throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.BeginExecuteMustNotReturnANullAsyncResult));
}
if (!object.ReferenceEquals(result.AsyncState, asyncContext))
{
throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.BeginExecuteMustUseProvidedStateAsAsyncResultState));
}
if (result.CompletedSynchronously)
{
this.EndExecute(context, result);
asyncContext.CompleteOperation();
}
flag = true;
}
finally
{
context.Dispose();
if (!flag)
{
asyncContext.CancelOperation();
}
}
}
示例5: Execute
public override bool Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
{
NativeActivityContext nativeContext = executor.NativeActivityContextPool.Acquire();
try
{
nativeContext.Initialize(this.ActivityInstance, executor, bookmarkManager);
this.callbackWrapper.Invoke(nativeContext, this.bookmark, this.state);
}
catch (Exception e)
{
if (Fx.IsFatal(e))
{
throw;
}
this.ExceptionToPropagate = e;
}
finally
{
nativeContext.Dispose();
executor.NativeActivityContextPool.Release(nativeContext);
}
return true;
}
示例6: Execute
public override bool Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
{
NativeActivityFaultContext faultContext = null;
try
{
faultContext = new NativeActivityFaultContext(base.ActivityInstance, executor, bookmarkManager, this.propagatedException, this.originalExceptionSource);
this.callbackWrapper.Invoke(faultContext, this.propagatedException, this.propagatedFrom);
if (!faultContext.IsFaultHandled)
{
base.SetExceptionToPropagateWithoutAbort(this.propagatedException);
}
}
catch (Exception exception)
{
if (Fx.IsFatal(exception))
{
throw;
}
base.ExceptionToPropagate = exception;
}
finally
{
if (faultContext != null)
{
faultContext.Dispose();
}
}
return true;
}
示例7: CreateWorkItem
internal WorkItem CreateWorkItem(ActivityInstance completedInstance, ActivityExecutor executor)
{
// We use the property to guard against the virtual method call
// since we don't need it in the common case
if (this.NeedsToGatherOutputs)
{
this.GatherOutputs(completedInstance);
}
CompletionWorkItem workItem;
if (this.checkForCancelation)
{
workItem = new CompletionWithCancelationCheckWorkItem(this, completedInstance);
}
else
{
workItem = executor.CompletionWorkItemPool.Acquire();
workItem.Initialize(this, completedInstance);
}
if (completedInstance.InstanceMap != null)
{
completedInstance.InstanceMap.AddEntry(workItem);
}
return workItem;
}
示例8: ReleaseToPool
protected override void ReleaseToPool(ActivityExecutor executor)
{
base.ClearForReuse();
this.nextArgumentIndex = 0;
this.resultLocation = null;
this.argumentValueOverrides = null;
executor.ResolveNextArgumentWorkItemPool.Release(this);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ResolveNextArgumentWorkItem.cs
示例9: PostProcess
public override void PostProcess(ActivityExecutor executor)
{
if ((this.completedInstance.State != ActivityInstanceState.Closed) && base.ActivityInstance.IsPerformingDefaultCancelation)
{
base.ActivityInstance.MarkCanceled();
}
base.PostProcess(executor);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:EmptyWithCancelationCheckWorkItem.cs
示例10: Execute
public override bool Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
{
if ((base.CompletedInstance.State != ActivityInstanceState.Closed) && base.ActivityInstance.IsPerformingDefaultCancelation)
{
base.ActivityInstance.MarkCanceled();
}
return base.Execute(executor, bookmarkManager);
}
示例11: BookmarkWorkItem
public BookmarkWorkItem(ActivityExecutor executor, bool isExternal, BookmarkCallbackWrapper callbackWrapper, Bookmark bookmark, object value)
: this(callbackWrapper, bookmark, value)
{
if (isExternal)
{
executor.EnterNoPersist();
this.ExitNoPersistRequired = true;
}
}
示例12: NativeActivityFaultContext
internal NativeActivityFaultContext(ActivityInstance executingActivityInstance,
ActivityExecutor executor, BookmarkManager bookmarkManager, Exception exception, ActivityInstanceReference source)
: base(executingActivityInstance, executor, bookmarkManager)
{
Fx.Assert(exception != null, "There must be an exception.");
Fx.Assert(source != null, "There must be a source.");
this.exception = exception;
this.source = source;
}
示例13: Dispose
public void Dispose(ActivityExecutor executor)
{
if (FxTrace.ShouldTraceVerboseToTraceSource)
{
this.TraceCompleted();
}
if (this.IsPooled)
{
this.ReleaseToPool(executor);
}
}
示例14: CreateWorkItem
public ActivityExecutionWorkItem CreateWorkItem(ActivityExecutor executor, bool isExternal, Bookmark bookmark, object value)
{
if (this.IsCallbackNull)
{
return executor.CreateEmptyWorkItem(this.ActivityInstance);
}
else
{
return new BookmarkWorkItem(executor, isExternal, this, bookmark, value);
}
}
示例15: 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);
}
}
}