重构了底层,方便向Android、Web、Linux进行跨平台迁移

This commit is contained in:
fengjiayi
2024-09-15 12:15:32 +08:00
parent 0271825fa9
commit 19247b5afe
51 changed files with 4987 additions and 1526 deletions

View File

@@ -0,0 +1,81 @@
using Serein.Library.Attributes;
using Serein.Library.Entity;
using Serein.Library.Utils;
using Serein.NodeFlow;
using Serein.NodeFlow.Tool;
using Serein.WorkBench.Node.View;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Serein.WorkBench
{
public class MainWindowViewModel
{
private readonly MainWindow window ;
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
}
}