diff --git a/Library/Api/IFlowEnvironment.cs b/Library/Api/IFlowEnvironment.cs index 46e5615..41ef41e 100644 --- a/Library/Api/IFlowEnvironment.cs +++ b/Library/Api/IFlowEnvironment.cs @@ -138,15 +138,15 @@ namespace Serein.Library.Api public class LoadDllEventArgs : FlowEventArgs { - public LoadDllEventArgs(NodeLibrary nodeLibrary, List MethodDetailss) + public LoadDllEventArgs(NodeLibraryInfo nodeLibraryInfo, List MethodDetailss) { - this.NodeLibrary = nodeLibrary; + this.NodeLibraryInfo = nodeLibraryInfo; this.MethodDetailss = MethodDetailss; } /// /// 已加载了的程序集 /// - public NodeLibrary NodeLibrary { get; protected set; } + public NodeLibraryInfo NodeLibraryInfo { get; protected set; } /// /// dll文件中有效的流程方法描述 /// @@ -676,8 +676,8 @@ namespace Serein.Library.Api /// /// 移除DLL /// - /// 程序集的名称 - bool RemoteDll(string assemblyFullName); + /// 程序集的名称 + bool RemoteDll(string assemblyName); /// /// 清理加载的DLL(待更改) diff --git a/Library/Entity/NodeLibrary.cs b/Library/Entity/NodeLibrary.cs deleted file mode 100644 index 32ca8fc..0000000 --- a/Library/Entity/NodeLibrary.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; - -namespace Serein.Library -{ - /// - /// 节点DLL依赖类,如果一个项目中引入了多个DLL,需要放置在同一个文件夹中 - /// - public class NodeLibrary - { - /// - /// 文件名 - /// - public string FileName { get; set; } - - /// - /// 路径 - /// - public string FilePath { get; set; } - - /// - /// 依赖类的名称 - /// - public string FullName{ get; set; } - - /// - /// 对应的程序集 - /// - public Assembly Assembly { get; set; } - } - -} diff --git a/Library/Entity/NodeLibraryInfo.cs b/Library/Entity/NodeLibraryInfo.cs new file mode 100644 index 0000000..801dac8 --- /dev/null +++ b/Library/Entity/NodeLibraryInfo.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using System.Text; + +namespace Serein.Library +{ + /// + /// 节点DLL依赖类,如果一个项目中引入了多个DLL,需要放置在同一个文件夹中 + /// + public class NodeLibraryInfo + { + /// + /// 文件名 + /// + public string FileName { get; set; } + + /// + /// 路径 + /// + public string FilePath { get; set; } + + /// + /// 所属的程序集名称 + /// + public string AssemblyName{ get; set; } + } + + + + /// + /// + /// + public class FlowLibrary + { + public FlowLibrary(string assemblyName, + Action actionOfUnloadAssmbly) + { + this.AssemblyName = assemblyName; + this.actionOfUnloadAssmbly = actionOfUnloadAssmbly; + } + + public string AssemblyName { get; } + + //public string AssemblyVersion { get; } + + /// + /// 加载程序集时创建的方法描述 + /// + public ConcurrentDictionary MethodDetailss { get; } = new ConcurrentDictionary(); + + /// + /// 管理通过Emit动态构建的委托 + /// + public ConcurrentDictionary DelegateDetailss { get; } = new ConcurrentDictionary(); + + /// + /// 记录不同的注册时机需要自动创建全局唯一实例的类型信息 + /// + public ConcurrentDictionary RegisterTypes { get; } = new ConcurrentDictionary(); + + + private readonly Action actionOfUnloadAssmbly; + + /// + /// 卸载当前程序集以及附带的所有信息 + /// + public void Upload() + { + actionOfUnloadAssmbly?.Invoke(); + } + + + /// + /// 通过方法名称获取对应的Emit委托(元数据),用于动态调用节点对应的方法 + /// + /// 方法名称 + /// Emit委托 + /// + public bool GetDelegateDetails(string methodName, out DelegateDetails dd) + { + return DelegateDetailss.TryGetValue(methodName, out dd); + } + + /// + /// 通过方法名称获取对应的方法描述(元数据),用于创建节点时,节点实例需要的方法描述 + /// + /// 方法名称 + /// 方法描述 + /// + public bool GetMethodDetails(string methodName, out MethodDetails md) + { + return MethodDetailss.TryGetValue(methodName, out md); + } + + public NodeLibraryInfo ToInfo() + { + return new NodeLibraryInfo + { + + } + } + + } + +} diff --git a/Library/FlowNode/MethodDetails.cs b/Library/FlowNode/MethodDetails.cs index dfe09ab..f9632bc 100644 --- a/Library/FlowNode/MethodDetails.cs +++ b/Library/FlowNode/MethodDetails.cs @@ -129,7 +129,7 @@ namespace Serein.Library && index < ParameterDetailss.Length) // 防止下标越界 { ParameterDetailss[index] = null; // 释放对象引用 - var tmp = ArrayHelper.RemoteToArray(ParameterDetailss, index); // 新增; + var tmp = ArrayHelper.RemoteToArray(ParameterDetailss, index); // 新增; UpdateParamIndex(ref tmp); ParameterDetailss = tmp; // 新增 return true; diff --git a/Library/FlowNode/MethodDetailsInfo.cs b/Library/FlowNode/MethodDetailsInfo.cs index 53e2fb9..2d484ea 100644 --- a/Library/FlowNode/MethodDetailsInfo.cs +++ b/Library/FlowNode/MethodDetailsInfo.cs @@ -12,9 +12,9 @@ namespace Serein.Library public class MethodDetailsInfo { /// - /// 属于哪个DLL文件 + /// 属于哪个程序集 /// - public string LibraryName { get; set; } + public string AssemblyName { get; set; } /// /// 方法名称 diff --git a/Library/FlowNode/SereinProjectData.cs b/Library/FlowNode/SereinProjectData.cs index c5d7a05..cbc1813 100644 --- a/Library/FlowNode/SereinProjectData.cs +++ b/Library/FlowNode/SereinProjectData.cs @@ -33,9 +33,9 @@ namespace Serein.Library public class LibraryMds { /// - /// 程序集FullName + /// 程序集名称 /// - public string LibraryName { get; set; } + public string AssemblyName { get; set; } /// /// 相关的方法详情 /// diff --git a/Library/Serein.Library.csproj b/Library/Serein.Library.csproj index b4a3b35..9d21c52 100644 --- a/Library/Serein.Library.csproj +++ b/Library/Serein.Library.csproj @@ -2,8 +2,8 @@ 1.0.19 - net8.0;net462 + net8.0;net462 D:\Project\C#\DynamicControl\SereinFlow\.Output True SereinFow @@ -37,8 +37,6 @@ - - @@ -60,4 +58,8 @@ + + + + diff --git a/NodeFlow/Env/FlowEnvironment.cs b/NodeFlow/Env/FlowEnvironment.cs index ab303cc..15aa873 100644 --- a/NodeFlow/Env/FlowEnvironment.cs +++ b/NodeFlow/Env/FlowEnvironment.cs @@ -223,24 +223,45 @@ namespace Serein.NodeFlow.Env #endregion #region 私有变量 + + /// + /// 通过程序集名称管理动态加载的程序集,用于节点创建提供方法描述,流程运行时提供Emit委托 + /// + public ConcurrentDictionary FlowLibrarys { get; } = []; + + /// /// Library 与 MethodDetailss的依赖关系 /// - public ConcurrentDictionary> MethodDetailsOfLibrarys { get; } = []; + public ConcurrentDictionary> MethodDetailsOfLibraryInfos { get; } = []; /// - /// 存储已加载的程序集 + /// 存储已加载的程序集 + /// Key:程序集的FullName + /// Value:构造的方法信息 /// - public ConcurrentDictionary Librarys { get; } = []; + public ConcurrentDictionary LibraryInfos { get; } = []; /// - /// 存储已加载的方法信息。描述所有DLL中NodeAction特性的方法的原始副本 + /// 存储已加载的方法信息。描述所有DLL中NodeAction特性的方法的原始副本 + /// Key:反射时获取的MethodInfo.MehtodName + /// Value:构造的方法信息 /// public ConcurrentDictionary MethodDetailss { get; } = []; - /// - /// 容器管理 + /// 从dll中加载的类的注册类型 + /// + private Dictionary> AutoRegisterTypes { get; } = []; + + /// + /// 存放所有通过Emit加载的委托 + /// md.Methodname - delegate + /// + private ConcurrentDictionary MethodDelegates { get; } = []; + + /// + /// IOC对象容器管理 /// private readonly SereinIOC sereinIOC; @@ -255,18 +276,7 @@ namespace Serein.NodeFlow.Env /// private List FlipflopNodes { get; } = []; - /// - /// 从dll中加载的类的注册类型 - /// - private Dictionary> AutoRegisterTypes { get; } = []; - /// - /// 存放委托 - /// - /// md.Methodname - delegate - /// - - private ConcurrentDictionary MethodDelegates { get; } = []; /// /// 起始节点私有属性 @@ -470,28 +480,28 @@ namespace Serein.NodeFlow.Env /// public async Task GetEnvInfoAsync() { - Dictionary> LibraryMds = []; + Dictionary> MdsOfLibraryInfos = []; - foreach (var mdskv in MethodDetailsOfLibrarys) + foreach (var mdskv in MethodDetailsOfLibraryInfos) { var library = mdskv.Key; var mds = mdskv.Value; foreach (var md in mds) { - if (!LibraryMds.TryGetValue(library, out var t_mds)) + if (!MdsOfLibraryInfos.TryGetValue(library, out var t_mds)) { t_mds = new List(); - LibraryMds[library] = t_mds; + MdsOfLibraryInfos[library] = t_mds; } var mdInfo = md.ToInfo(); - mdInfo.LibraryName = library.FullName; + mdInfo.AssemblyName = library.AssemblyName; t_mds.Add(mdInfo); } } - LibraryMds[] libraryMdss = LibraryMds.Select(kv => new LibraryMds + LibraryMds[] libraryMdss = MdsOfLibraryInfos.Select(kv => new LibraryMds { - LibraryName = kv.Key.FullName, + AssemblyName = kv.Key.AssemblyName, Mds = kv.Value.ToArray() }).ToArray(); var project = await GetProjectInfoAsync(); @@ -716,7 +726,7 @@ namespace Serein.NodeFlow.Env { var projectData = new SereinProjectData() { - Librarys = Librarys.Values.Select(lib => lib.ToLibrary()).ToArray(), + Librarys = LibraryInfos.Values.Select(lib => lib.ToLibrary()).ToArray(), Nodes = NodeModels.Values.Select(node => node.ToInfo()).Where(info => info is not null).ToArray(), StartNode = NodeModels.Values.FirstOrDefault(it => it.IsStart)?.Guid, }; @@ -738,11 +748,11 @@ namespace Serein.NodeFlow.Env /// /// 移除DLL /// - /// + /// /// - public bool RemoteDll(string assemblyFullName) + public bool RemoteDll(string assemblyName) { - var library = Librarys.Values.FirstOrDefault(nl => assemblyFullName.Equals(nl.FullName)); + var library = LibraryInfos.Values.FirstOrDefault(nl => assemblyName.Equals(nl.AssemblyName)); if (library is null) { return false; @@ -761,7 +771,7 @@ namespace Serein.NodeFlow.Env return true; // 当前无节点,可以直接删除 } - if (MethodDetailsOfLibrarys.TryGetValue(library, out var mds)) // 存在方法 + if (MethodDetailsOfLibraryInfos.TryGetValue(library, out var mds)) // 存在方法 { foreach (var md in mds) { @@ -778,7 +788,7 @@ namespace Serein.NodeFlow.Env { MethodDetailss.TryRemove(md.MethodName, out _); } - MethodDetailsOfLibrarys.TryRemove(library, out _); + MethodDetailsOfLibraryInfos.TryRemove(library, out _); return true; } else @@ -1395,35 +1405,56 @@ namespace Serein.NodeFlow.Env /// private void LoadDllNodeInfo(string dllPath) { - (var nodeLibrary, var registerTypes, var mdlist) = LoadAssembly(dllPath); - if (nodeLibrary is not null && mdlist.Count > 0) + + var fileName = Path.GetFileName(dllPath); + AssemblyLoadContext flowAlc = new AssemblyLoadContext(fileName, true); + flowAlc.LoadFromAssemblyPath(dllPath); // 加载指定路径的程序集 + + foreach(var assemblt in flowAlc.Assemblies) { - Librarys.TryAdd(nodeLibrary.FullName, nodeLibrary); - MethodDetailsOfLibrarys.TryAdd(nodeLibrary, mdlist); - - foreach (var md in mdlist) + (var registerTypes, var mdlist) = LoadAssembly(assemblt); + if (mdlist.Count > 0) { - MethodDetailss.TryAdd(md.MethodName, md); - } - - foreach (var kv in registerTypes) - { - if (!AutoRegisterTypes.TryGetValue(kv.Key, out var types)) + var nodeLibraryInfo = new NodeLibraryInfo { - types = new List(); - AutoRegisterTypes.Add(kv.Key, types); + //Assembly = assembly, + AssemblyName = assemblt.FullName, + FileName = Path.GetFileName(dllPath), + FilePath = dllPath, + }; + + LibraryInfos.TryAdd(nodeLibraryInfo.AssemblyName, nodeLibraryInfo); + MethodDetailsOfLibraryInfos.TryAdd(nodeLibraryInfo, mdlist); + + foreach (var md in mdlist) + { + MethodDetailss.TryAdd(md.MethodName, md); } - types.AddRange(kv.Value); - } - var mdInfos = mdlist.Select(md => md.ToInfo()).ToList(); // 转换成方法信息 - if (OperatingSystem.IsWindows()) - { - UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(nodeLibrary, mdInfos))); // 通知UI创建dll面板显示 + foreach (var kv in registerTypes) + { + if (!AutoRegisterTypes.TryGetValue(kv.Key, out var types)) + { + types = new List(); + AutoRegisterTypes.Add(kv.Key, types); + } + types.AddRange(kv.Value); + } + var mdInfos = mdlist.Select(md => md.ToInfo()).ToList(); // 转换成方法信息 + if (OperatingSystem.IsWindows()) + { + UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(nodeLibraryInfo, mdInfos))); // 通知UI创建dll面板显示 + + } } + + } + + + } /// @@ -1477,18 +1508,17 @@ namespace Serein.NodeFlow.Env } /// - /// + /// 动态加载程序集 /// - /// + /// 程序集本身 /// - private (NodeLibrary?, Dictionary>, List) LoadAssembly(string dllPath) + private (Dictionary>, List) LoadAssembly(Assembly assembly) { try { - //FlowLibraryLoader flowLibraryLoader = new FlowLibraryLoader(dllPath); - //Assembly assembly = flowLibraryLoader.LoadFromAssemblyPath(dllPath); - Assembly assembly = Assembly.LoadFrom(dllPath); // 加载DLL文件 List types = assembly.GetTypes().ToList(); // 获取程序集中的所有类型 + + #region 获取所有需要注册的类型 Dictionary> autoRegisterTypes = new Dictionary>(); foreach (Type type in types) { @@ -1504,25 +1534,29 @@ namespace Serein.NodeFlow.Env } } + #endregion + #region 获取 DynamicFlow 特性的流程控制器,如果没有返回空 List<(Type, string)> scanTypes = types.Select(t => - { - if (t.GetCustomAttribute() is DynamicFlowAttribute dynamicFlowAttribute - && dynamicFlowAttribute.Scan == true) - { - return (t, dynamicFlowAttribute.Name); - } - else - { - return (null, null); - } - }).Where(it => it.t is not null).ToList(); + { + if (t.GetCustomAttribute() is DynamicFlowAttribute dynamicFlowAttribute + && dynamicFlowAttribute.Scan == true) + { + return (t, dynamicFlowAttribute.Name); + } + else + { + return (null, null); + } + }).Where(it => it.t is not null).ToList(); if (scanTypes.Count == 0) { - return (null, [], []); + return ([], []); } + #endregion + #region 创建对应的方法元数据 List methodDetails = new List(); // 遍历扫描的类型 foreach ((var type, var flowName) in scanTypes) @@ -1552,23 +1586,16 @@ namespace Serein.NodeFlow.Env Console.WriteLine($"节点委托创建失败:{md.MethodName}"); } } - } + } + #endregion - var nodeLibrary = new NodeLibrary - { - FullName = assembly.GetName().FullName, - Assembly = assembly, - FileName = Path.GetFileName(dllPath), - FilePath = dllPath, - }; - //LoadedAssemblies.Add(assembly); // 将加载的程序集添加到列表中 - //LoadedAssemblyPaths.Add(dllPath); // 记录加载的DLL路径 - return (nodeLibrary, autoRegisterTypes, methodDetails); + + return (autoRegisterTypes, methodDetails); } catch (Exception ex) { Console.WriteLine(ex.ToString()); - return (null, [], []); + return ([], []); } } diff --git a/NodeFlow/Env/FlowEnvironmentDecorator.cs b/NodeFlow/Env/FlowEnvironmentDecorator.cs index 1b802ad..c46f69b 100644 --- a/NodeFlow/Env/FlowEnvironmentDecorator.cs +++ b/NodeFlow/Env/FlowEnvironmentDecorator.cs @@ -307,9 +307,9 @@ namespace Serein.NodeFlow.Env } - public bool RemoteDll(string assemblyFullName) + public bool RemoteDll(string assemblyName) { - return currentFlowEnvironment.RemoteDll(assemblyFullName); + return currentFlowEnvironment.RemoteDll(assemblyName); } public async Task RemoveConnectInvokeAsync(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType) diff --git a/NodeFlow/Env/FlowFunc.cs b/NodeFlow/Env/FlowFunc.cs index 46f7421..687ebc5 100644 --- a/NodeFlow/Env/FlowFunc.cs +++ b/NodeFlow/Env/FlowFunc.cs @@ -87,16 +87,17 @@ namespace Serein.NodeFlow.Env /// /// 程序集封装依赖 /// - /// + /// /// - public static Library.Library ToLibrary(this Library.NodeLibrary library) + public static Library.Library ToLibrary(this Library.NodeLibraryInfo libraryInfo) { - var tmp = library.Assembly.ManifestModule.Name; + //var tmp = library.Assembly.ManifestModule.Name; return new Library.Library { - AssemblyName = library.Assembly.GetName().Name, - FileName = library.FileName, - FilePath = library.FilePath, + AssemblyName = libraryInfo.AssemblyName, + //AssemblyName = library.Assembly.GetName().Name, + FileName = libraryInfo.FileName, + FilePath = libraryInfo.FilePath, }; } diff --git a/NodeFlow/Env/RemoteFlowEnvironment.cs b/NodeFlow/Env/RemoteFlowEnvironment.cs index 87a94f0..82c4746 100644 --- a/NodeFlow/Env/RemoteFlowEnvironment.cs +++ b/NodeFlow/Env/RemoteFlowEnvironment.cs @@ -112,6 +112,11 @@ namespace Serein.NodeFlow.Env return prjectInfo; } + /// + /// 远程环境下加载项目 + /// + /// + /// public void LoadProject(FlowEnvInfo flowEnvInfo, string filePath) { Console.WriteLine("加载远程环境"); @@ -120,13 +125,13 @@ namespace Serein.NodeFlow.Env var libmds = flowEnvInfo.LibraryMds; foreach (var lib in libmds) { - NodeLibrary nodeLibrary = new NodeLibrary + NodeLibraryInfo nodeLibraryInfo = new NodeLibraryInfo { - FullName = lib.LibraryName, + AssemblyName = lib.AssemblyName, FilePath = "Remote", }; var mdInfos = lib.Mds.ToList(); - UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(nodeLibrary, mdInfos))); // 通知UI创建dll面板显示 + UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(nodeLibraryInfo, mdInfos))); // 通知UI创建dll面板显示 foreach (var mdInfo in mdInfos) { MethodDetailss.TryAdd(mdInfo.MethodName, new MethodDetails(mdInfo)); // 从DLL读取时生成元数据 @@ -397,7 +402,7 @@ namespace Serein.NodeFlow.Env Console.WriteLine("远程环境尚未实现的接口:LoadDll"); } - public bool RemoteDll(string assemblyFullName) + public bool RemoteDll(string assemblyName) { // 尝试移除远程环境中的加载了的依赖 Console.WriteLine("远程环境尚未实现的接口:RemoteDll"); diff --git a/NodeFlow/Tool/FlowLibraryLoader.cs b/NodeFlow/Tool/FlowLibraryLoader.cs index 6be1d4b..e1e2115 100644 --- a/NodeFlow/Tool/FlowLibraryLoader.cs +++ b/NodeFlow/Tool/FlowLibraryLoader.cs @@ -15,6 +15,8 @@ namespace Serein.NodeFlow.Tool { private Assembly _pluginAssembly; + public string FullName => _pluginAssembly.FullName; + /// /// 加载程序集 /// @@ -35,6 +37,12 @@ namespace Serein.NodeFlow.Tool return null; // 保持默认加载行为 } + + public List LoadFlowTypes() + { + return _pluginAssembly.GetTypes().ToList(); + } + /// /// 是否对程序集的引用 /// diff --git a/NodeFlow/Tool/NodeMethodDetailsHelper.cs b/NodeFlow/Tool/NodeMethodDetailsHelper.cs index 58c53e3..9e88725 100644 --- a/NodeFlow/Tool/NodeMethodDetailsHelper.cs +++ b/NodeFlow/Tool/NodeMethodDetailsHelper.cs @@ -19,6 +19,7 @@ public static class NodeMethodDetailsHelper return type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) .Where(m => m.GetCustomAttribute()?.Scan == true); } + /// /// 创建方法信息 /// @@ -250,22 +251,6 @@ public static class NodeMethodDetailsHelper IsParams = hasParams, // 判断是否为可变参数 }; - //string explicitTypeName = GetExplicitTypeName(explicitParemType); - //var items = GetExplicitItems(explicitParemType, explicitTypeName); - //if ("Bool".Equals(explicitTypeName)) explicitTypeName = "Select"; // 布尔值 转为 可选类型 - //return new ParameterDetails - //{ - // IsExplicitData = isExplicitData, //attribute is null ? parameterInfo.HasDefaultValue : true, - // Index = index, // 索引 - // ExplicitTypeName = explicitTypeName, // Select/Bool/Value - // ExplicitType = explicitParemType,// 显示的入参类型 - // Convertor = func, // 转换器 - // DataType = dataType, // 实际的入参类型 - // Name = parameterInfo.Name, - // DataValue = parameterInfo.HasDefaultValue ? parameterInfo?.DefaultValue?.ToString() : "", // 如果存在默认值,则使用默认值 - // Items = items.ToArray(), // 如果是枚举值入参,则获取枚举类型的字面量 - // IsParams = hasParams, // 判断是否为可变参数 - //}; } diff --git a/WorkBench/MainWindow.xaml.cs b/WorkBench/MainWindow.xaml.cs index 4ff7d56..fc0e987 100644 --- a/WorkBench/MainWindow.xaml.cs +++ b/WorkBench/MainWindow.xaml.cs @@ -316,10 +316,10 @@ namespace Serein.Workbench /// private void FlowEnvironment_DllLoadEvent(LoadDllEventArgs eventArgs) { - NodeLibrary nodeLibrary = eventArgs.NodeLibrary; + NodeLibraryInfo nodeLibraryInfo = eventArgs.NodeLibraryInfo; List methodDetailss = eventArgs.MethodDetailss; - var dllControl = new DllControl(nodeLibrary); + var dllControl = new DllControl(nodeLibraryInfo); foreach (var methodDetailsInfo in methodDetailss) { @@ -341,7 +341,7 @@ namespace Serein.Workbench var menu = new ContextMenu(); menu.Items.Add(CreateMenuItem("卸载", (s, e) => { - if (this.EnvDecorator.RemoteDll(nodeLibrary.FullName)) + if (this.EnvDecorator.RemoteDll(nodeLibraryInfo.AssemblyName)) { DllStackPanel.Children.Remove(dllControl); } diff --git a/WorkBench/Node/View/DllControlControl.xaml.cs b/WorkBench/Node/View/DllControlControl.xaml.cs index cb01118..014973e 100644 --- a/WorkBench/Node/View/DllControlControl.xaml.cs +++ b/WorkBench/Node/View/DllControlControl.xaml.cs @@ -16,17 +16,17 @@ namespace Serein.Workbench.Node.View /// public partial class DllControl : UserControl { - private readonly NodeLibrary nodeLibrary; + private readonly NodeLibraryInfo nodeLibraryInfo; public DllControl() { Header = "DLL文件"; // 设置初始值 InitializeComponent(); } - public DllControl(NodeLibrary nodeLibrary) + public DllControl(NodeLibraryInfo nodeLibraryInfo) { - this.nodeLibrary = nodeLibrary; - Header = "DLL name : " + nodeLibrary.FullName; + this.nodeLibraryInfo = nodeLibraryInfo; + Header = "DLL name : " + nodeLibraryInfo.AssemblyName; InitializeComponent(); }