mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 23:26:35 +08:00
block
This commit is contained in:
@@ -176,7 +176,20 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
SetProperty(ref _actualItemHeight, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IParameter _parameter;
|
||||
public IParameter Parameter
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parameter;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _parameter, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<BlockDesignerItemViewModel> _children = new ObservableCollection<BlockDesignerItemViewModel>();
|
||||
public ObservableCollection<BlockDesignerItemViewModel> Children
|
||||
@@ -322,7 +335,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (OnlyOneChild)
|
||||
{
|
||||
return Children.FirstOrDefault()?.GetResult();
|
||||
if (Children?.Count == 1)
|
||||
{
|
||||
return Children.FirstOrDefault()?.GetResult();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Parameter?.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AIStudio.Wpf.DiagramDesigner.Geometrys;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
@@ -248,6 +249,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isExecuting;
|
||||
public bool IsExecuting
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isExecuting;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _isExecuting, value);
|
||||
}
|
||||
}
|
||||
|
||||
public string Flag
|
||||
{
|
||||
get; set;
|
||||
@@ -409,11 +423,29 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
#region 执行
|
||||
public virtual void Execute()
|
||||
public void Execute()
|
||||
{
|
||||
BeforeExecute();
|
||||
Executing();
|
||||
AfterExecute();
|
||||
}
|
||||
|
||||
public virtual void BeforeExecute()
|
||||
{
|
||||
IsExecuting = true;
|
||||
}
|
||||
|
||||
public virtual void Executing()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void AfterExecute()
|
||||
{
|
||||
IsExecuting = false;
|
||||
Next?.Execute();
|
||||
}
|
||||
|
||||
public virtual object GetResult()
|
||||
{
|
||||
if (FirstContainer != null)
|
||||
|
||||
Reference in New Issue
Block a user