mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
优化了运行环境与启动器的运行逻辑,以及IOC容器的注册/绑定/获取对象的机制
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user