本文整理汇总了C#中NativeActivityContext.ScheduleActivity方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.ScheduleActivity方法的具体用法?C# NativeActivityContext.ScheduleActivity怎么用?C# NativeActivityContext.ScheduleActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityContext
的用法示例。
在下文中一共展示了NativeActivityContext.ScheduleActivity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.Condition.Get(context))
{
if (this.Then != null)
{
context.ScheduleActivity(this.Then);
}
}
else if (this.Else != null)
{
context.ScheduleActivity(this.Else);
}
}
示例2: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.Body != null)
{
context.ScheduleActivity(this.Body, new CompletionCallback(OnBodyComplete));
}
}
示例3: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.Child != null)
{
context.ScheduleActivity(Child, this.onChildComplete);
}
}
示例4: OnExecuteBodyCompleted
private void OnExecuteBodyCompleted(NativeActivityContext context, ActivityInstance instance)
{
var vars = ComputationContext.GetVariables(context, this);
vars.Set(IterationNoVarName, vars.Get<int>(IterationNoVarName) + 1);
context.ScheduleActivity(Condition, OnExecuteConditionCompleted);
}
示例5: InternalExecute
void InternalExecute(NativeActivityContext context, ActivityInstance completedInstance)
{
CompensationExtension compensationExtension = context.GetExtension<CompensationExtension>();
if (compensationExtension == null)
{
throw FxTrace.Exception.AsError(new InvalidOperationException(SR.ConfirmWithoutCompensableActivity(this.DisplayName)));
}
CompensationToken token = Target.Get(context);
CompensationTokenData tokenData = token == null ? null : compensationExtension.Get(token.CompensationId);
Fx.Assert(tokenData != null, "CompensationTokenData must be valid");
if (tokenData.ExecutionTracker.Count > 0)
{
if (this.onChildConfirmed == null)
{
this.onChildConfirmed = new CompletionCallback(InternalExecute);
}
this.toConfirmToken.Set(context, new CompensationToken(tokenData.ExecutionTracker.Get()));
Fx.Assert(Body != null, "Body must be valid");
context.ScheduleActivity(Body, this.onChildConfirmed);
}
}
示例6: Execute
protected override void Execute(NativeActivityContext context)
{
if (Body != null)
{
context.Properties.Add(VariableCollPropName, new GenericVariableCollection());
context.ScheduleActivity(Body, OnBodyCompleted);
}
}
示例7: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.Body != null)
{
this.noPersistHandle.Get(context).Enter(context);
context.ScheduleActivity(this.Body);
}
}
示例8: Execute
protected override void Execute(NativeActivityContext context)
{
string name = this.BookmarkName.Get(context);
this.outputText.Set(context, "Please enter a value: ");
context.ScheduleActivity(output);
context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
}
示例9: Execute
protected override void Execute(NativeActivityContext context)
{
if ((this.activities != null) && (this.Activities.Count > 0))
{
Activity activity = this.Activities[0];
context.ScheduleActivity(activity, this.onChildComplete);
}
}
示例10: Execute
protected override void Execute(NativeActivityContext context)
{
if (Body != null)
{
ReceiveRequestSendResponseScopeExecutionProperty executionProperty = receiveRequestSendResponseScopeExecutionPropertyFactory();
context.Properties.Add(ExecutionPropertyName, executionProperty);
context.ScheduleActivity(Body, BodyCompletionCallback, BodyFaultCallback);
}
}
示例11: Execute
protected override void Execute(NativeActivityContext context)
{
context.Properties.Add(ConsoleColorProperty.Name, new ConsoleColorProperty(this.Color));
if (this.Body != null)
{
context.ScheduleActivity(this.Body);
}
}
示例12: Execute
// Execute the activity (enter the NoPersistScope)
protected override void Execute(NativeActivityContext context)
{
NoPersistHandle handle = this.noPersistHandle.Get(context);
handle.Enter(context);
if (Body != null)
{
context.ScheduleActivity(Body);
}
}
示例13: Execute
// Executes the logic of the activity
protected override void Execute(NativeActivityContext context)
{
// Prepare the log message, and log it to a file
string logPath = LogPath.Get(context);
string comment = Comment.Get(context);
string[] logMessage = new string[] {
"[" + DateTime.Now + "]",
"Please validate that activity '" + comment + "' has completed successfully.",
"If it has, delete this file and resume the workflow.",
""
};
System.IO.File.AppendAllLines(logPath, logMessage);
// Schedule the user's desired activity, and then schedule the suspend activity.
// When the suspend activity is complete, tell workflow to call our OnWorkflowResumed
// method.
context.ScheduleActivity(Action);
context.ScheduleActivity(suspendActivity, OnWorkflowResumed);
}
示例14: Execute
protected override void Execute(NativeActivityContext context)
{
if ((this.branches != null) && (this.Branches.Count != 0))
{
CompletionCallback onCompleted = new CompletionCallback(this.OnBranchComplete);
for (int i = this.Branches.Count - 1; i >= 0; i--)
{
context.ScheduleActivity(this.Branches[i], onCompleted);
}
}
}
示例15: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.Body != null)
{
if (this.DisallowPersistence(context))
{
NoPersistHandle handle = this.noPersistHandle.Get(context);
handle.Enter(context);
}
context.ScheduleActivity(this.Body);
}
}