从节点Model解耦出容器接口,重新设计了节点的保存、加载。

This commit is contained in:
fengjiayi
2024-12-24 22:23:53 +08:00
parent 949ac973bc
commit 5b0ba84fd6
30 changed files with 979 additions and 760 deletions

View File

@@ -6,17 +6,25 @@ using Serein.Library.Utils;
using Serein.Library.Utils.SereinExpression;
using Serein.NodeFlow.Model;
using Serein.Script;
using SqlSugar;
using System.Diagnostics;
using System.IO;
using System.Linq.Expressions;
using System.Reflection;
using System.Windows;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using Expression = System.Linq.Expressions.Expression;
namespace Serein.Workbench
{
#if DEBUG
public class People
{
public string Name { get; set; }
public int Id { get; set; }
public int Age { get; set; }
}
#endif
@@ -28,11 +36,9 @@ namespace Serein.Workbench
{
void LoadLocalProject()
{
#if DEBUG
if (1 == 1)
if (1 == 11)
{
// 这里是我自己的测试代码,你可以删除
string filePath;
filePath = @"C:\Users\Az\source\repos\CLBanyunqiState\CLBanyunqiState\bin\Release\net8.0\PLCproject.dnf";
@@ -42,7 +48,6 @@ namespace Serein.Workbench
App.FlowProjectData = JsonConvert.DeserializeObject<SereinProjectData>(content);
App.FileDataPath = System.IO.Path.GetDirectoryName(filePath)!; // filePath;//
var dir = Path.GetDirectoryName(filePath);
//System.IO.Directory.SetCurrentDirectory(dir);
}
#endif
}
@@ -50,26 +55,8 @@ namespace Serein.Workbench
public static SereinProjectData? FlowProjectData { get; set; }
public static string FileDataPath { get; set; } = "";
public App()
{
}
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
// 强制关闭所有窗口
foreach (Window window in Windows)
{
window.Close();
}
}
private void Application_Startup(object sender, StartupEventArgs e)
{
Application.Current.Dispatcher.Invoke(() => { });
// 检查是否传入了参数
if (e.Args.Length == 1)
{