mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-04 08:40:51 +08:00
block demo 已经完成到第三个了
This commit is contained in:
@@ -469,23 +469,35 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public async Task Execute()
|
||||
{
|
||||
await BeforeExecute();
|
||||
await Executing();
|
||||
await AfterExecute();
|
||||
await StopExecution();
|
||||
await BeforeExecution();
|
||||
if (await Executing())
|
||||
{
|
||||
await AfterExecution();
|
||||
}
|
||||
else
|
||||
{
|
||||
IsExecuting = false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Task BeforeExecute()
|
||||
public virtual Task BeforeExecution()
|
||||
{
|
||||
IsExecuting = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual Task Executing()
|
||||
public virtual Task<bool> Executing()
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public virtual Task StopExecution()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public virtual async Task AfterExecute()
|
||||
public virtual async Task AfterExecution()
|
||||
{
|
||||
if (IsExecuting)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user