mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-22 17:36:36 +08:00
block
This commit is contained in:
@@ -10,19 +10,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
{
|
{
|
||||||
public class ConstParameter : BindableBase, IParameter
|
public class ConstParameter : BindableBase, IParameter
|
||||||
{
|
{
|
||||||
private ISelectable _item;
|
|
||||||
|
|
||||||
public ISelectable Item
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _item;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetProperty(ref _item, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string _text;
|
private string _text;
|
||||||
|
|
||||||
@@ -53,7 +41,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool IsPublic { get; set; } = true;
|
|
||||||
|
|
||||||
public void Add(object value)
|
public void Add(object value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
{
|
{
|
||||||
public interface IParameter
|
public interface IParameter
|
||||||
{
|
{
|
||||||
ISelectable Item
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
string Text
|
string Text
|
||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
@@ -17,11 +12,6 @@
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPublic
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Add(object value);
|
void Add(object value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
using System;
|
|
||||||
using AIStudio.Wpf.DiagramDesigner;
|
|
||||||
|
|
||||||
namespace AIStudio.Wpf.DiagramDesigner
|
|
||||||
{
|
|
||||||
public class VarParameter : ConstParameter
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -435,6 +435,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
{
|
{
|
||||||
Left = value.X;
|
Left = value.X;
|
||||||
Top = value.Y;
|
Top = value.Y;
|
||||||
|
RaisePropertyChanged(nameof(TopLeft));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
ItemHeight = double.NaN;
|
ItemHeight = double.NaN;
|
||||||
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Top));
|
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Top));
|
||||||
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Bottom));
|
AddConnector(new BlockConnectorInfo(this.Root, this, ConnectorOrientation.Bottom));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Init(IDiagramViewModel root, bool initNew)
|
protected override void Init(IDiagramViewModel root, bool initNew)
|
||||||
@@ -423,27 +423,29 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 执行
|
#region 执行
|
||||||
public void Execute()
|
public async Task Execute()
|
||||||
{
|
{
|
||||||
BeforeExecute();
|
await BeforeExecute();
|
||||||
Executing();
|
await Executing();
|
||||||
AfterExecute();
|
await AfterExecute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void BeforeExecute()
|
public virtual Task BeforeExecute()
|
||||||
{
|
{
|
||||||
IsExecuting = true;
|
IsExecuting = true;
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Executing()
|
public virtual Task Executing()
|
||||||
{
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AfterExecute()
|
public virtual async Task AfterExecute()
|
||||||
{
|
{
|
||||||
IsExecuting = false;
|
IsExecuting = false;
|
||||||
Next?.Execute();
|
if (Next != null)
|
||||||
|
await Next.Execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual object GetResult()
|
public virtual object GetResult()
|
||||||
|
|||||||
Reference in New Issue
Block a user