添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MW.WorkFlow;
|
||||
using MainShell.Common;
|
||||
|
||||
namespace MainShell.Process
|
||||
{
|
||||
public class SubstrateLoadActivity : ActivityAbstractBase
|
||||
{
|
||||
public SubstrateLoadActivity(string name) : base(name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override async Task<ActivityResult> OnExecuteAsync(WorkflowContext context, ActivityControl activityControl)
|
||||
{
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
activityControl.ThrowIfCancellationRequested();
|
||||
await activityControl.CheckPauseAsync();
|
||||
await Task.Delay(100, activityControl.CancellationToken);
|
||||
}
|
||||
|
||||
context.SetData(WorkflowContextKeys.SubstrateProcessState, SubstrateLifecycleState.Loaded);
|
||||
|
||||
return ActivityResult.Success;
|
||||
}
|
||||
protected override void PrepareExecute(WorkflowContext context, ActivityControl activityControl)
|
||||
{
|
||||
// Custom preparation logic before execution
|
||||
}
|
||||
protected override void AfterExecute(WorkflowContext context, ActivityControl activityControl)
|
||||
{
|
||||
// Custom cleanup logic after execution
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user