mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-31 21:46:34 +08:00
移除了中断相关的后台代码与UI交互(待重写);重写运行时节点获取参数的方法;重写了节点容器的互动;完善了WebSocket远程交互;完善了项目文件的加载;
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Serein.NodeFlow.Model
|
||||
/// <summary>
|
||||
/// 表达式
|
||||
/// </summary>
|
||||
[PropertyInfo(IsNotification = true, CustomCodeAtStart = "ChangeName(value);")]
|
||||
[PropertyInfo(IsNotification = true, CustomCodeAtStart = "// ChangeName(value);")]
|
||||
private string _keyName;
|
||||
|
||||
}
|
||||
@@ -52,42 +52,51 @@ namespace Serein.NodeFlow.Model
|
||||
private NodeModelBase? DataNode;
|
||||
|
||||
|
||||
public void PlaceNode(NodeModelBase nodeModel)
|
||||
public bool PlaceNode(NodeModelBase nodeModel)
|
||||
{
|
||||
// 全局数据节点只有一个子控件
|
||||
if (DataNode is not null)
|
||||
if(DataNode is null)
|
||||
{
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
await this.Env.RemoveNodeAsync(DataNode?.Guid);
|
||||
DataNode = nodeModel;
|
||||
});
|
||||
// 放置节点
|
||||
nodeModel.ContainerNode = this;
|
||||
ChildrenNode.Add(nodeModel);
|
||||
DataNode = nodeModel;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DataNode = nodeModel;
|
||||
// 全局数据节点只有一个子控件
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void TakeOutAll()
|
||||
|
||||
public bool TakeOutNode(NodeModelBase nodeModel)
|
||||
{
|
||||
if (ChildrenNode.Contains(nodeModel))
|
||||
{
|
||||
ChildrenNode.Remove(nodeModel);
|
||||
nodeModel.ContainerNode = null;
|
||||
DataNode = null;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async void TakeOutAll()
|
||||
{
|
||||
foreach (var nodeModel in ChildrenNode)
|
||||
{
|
||||
await nodeModel.Env.TakeOutNodeToContainerAsync(nodeModel.Guid);
|
||||
}
|
||||
DataNode = null;
|
||||
}
|
||||
|
||||
public void TakeOutNode(NodeModelBase nodeModel)
|
||||
{
|
||||
DataNode = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置数据节点
|
||||
/// </summary>
|
||||
/// <param name="dataNode"></param>
|
||||
//public void SetDataNode(NodeModelBase dataNode)
|
||||
//{
|
||||
// DataNodeGuid = dataNode.Guid;
|
||||
//}
|
||||
|
||||
private void ChangeName(string newName)
|
||||
{
|
||||
if(SereinEnv.GetFlowGlobalData(_keyName) == null)
|
||||
|
||||
Reference in New Issue
Block a user