优化了运行环境与启动器的运行逻辑,以及IOC容器的注册/绑定/获取对象的机制

This commit is contained in:
fengjiayi
2024-09-16 21:38:34 +08:00
parent bcbf6cb992
commit e20855a076
13 changed files with 551 additions and 970 deletions

View File

@@ -1,4 +1,5 @@
using Serein.Library.Attributes;
using Serein.Library.Api;
using Serein.Library.Attributes;
using Serein.Library.Entity;
using Serein.Library.Utils;
using Serein.NodeFlow;
@@ -18,64 +19,13 @@ namespace Serein.WorkBench
public class MainWindowViewModel
{
private readonly MainWindow window ;
public IFlowEnvironment FlowEnvironment { get; set; }
public MainWindowViewModel(MainWindow window)
{
FlowEnvironment = new FlowEnvironment();
this.window = window;
}
public FlowEnvironment FlowEnvironment { get; set; }
#region
public void LoadProjectFile(SereinOutputFileData projectFile)
{
var dllPaths = projectFile.Librarys.Select(it => it.Path).ToList();
foreach (var dll in dllPaths)
{
var filePath = System.IO.Path.GetFullPath(System.IO.Path.Combine(App.FileDataPath, dll));
//LoadAssembly(filePath);
}
}
private void DisplayControlDll(Assembly assembly,
List<MethodDetails> conditionTypes,
List<MethodDetails> actionTypes,
List<MethodDetails> flipflopMethods)
{
var dllControl = new DllControl
{
Header = "DLL name : " + assembly.GetName().Name // 设置控件标题为程序集名称
};
foreach (var item in actionTypes)
{
dllControl.AddAction(item.Clone()); // 添加动作类型到控件
}
foreach (var item in flipflopMethods)
{
dllControl.AddFlipflop(item.Clone()); // 添加触发器方法到控件
}
/*foreach (var item in stateTypes)
{
dllControl.AddState(item);
}*/
window.DllStackPanel.Children.Add(dllControl); // 将控件添加到界面上显示
}
#endregion
}
}