This commit is contained in:
艾竹
2023-07-23 17:40:44 +08:00
parent e34f7fd5a3
commit 2d345fb076
5 changed files with 14 additions and 44 deletions

View File

@@ -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)
{ {

View File

@@ -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);
} }

View File

@@ -1,10 +0,0 @@
using System;
using AIStudio.Wpf.DiagramDesigner;
namespace AIStudio.Wpf.DiagramDesigner
{
public class VarParameter : ConstParameter
{
}
}

View File

@@ -435,6 +435,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{ {
Left = value.X; Left = value.X;
Top = value.Y; Top = value.Y;
RaisePropertyChanged(nameof(TopLeft));
} }
} }

View File

@@ -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()