mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-20 08:16:34 +08:00
新增了卸载程序集的功能
This commit is contained in:
@@ -520,7 +520,7 @@ namespace Serein.NodeFlow.Env
|
||||
foreach (var dllPath in dllPaths)
|
||||
{
|
||||
var dllFilePath = Path.GetFullPath(Path.Combine(filePath, dllPath));
|
||||
LoadDll(dllFilePath); // 加载项目文件时加载对应的程序集
|
||||
LoadLibrary(dllFilePath); // 加载项目文件时加载对应的程序集
|
||||
}
|
||||
|
||||
List<(NodeModelBase, string[])> regionChildNodes = new List<(NodeModelBase, string[])>();
|
||||
@@ -722,10 +722,20 @@ namespace Serein.NodeFlow.Env
|
||||
/// </summary>
|
||||
/// <param name="dllPath"></param>
|
||||
/// <returns></returns>
|
||||
public void LoadDll(string dllPath)
|
||||
public void LoadLibrary(string dllPath)
|
||||
{
|
||||
(var libraryInfo, var mdInfos) = FlowLibraryManagement.LoadLibrary(dllPath);
|
||||
UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(libraryInfo, mdInfos))); // 通知UI创建dll面板显示
|
||||
try
|
||||
{
|
||||
(var libraryInfo, var mdInfos) = FlowLibraryManagement.LoadLibrary(dllPath);
|
||||
if (mdInfos.Count > 0)
|
||||
{
|
||||
UIContextOperation?.Invoke(() => OnDllLoad?.Invoke(new LoadDllEventArgs(libraryInfo, mdInfos))); // 通知UI创建dll面板显示
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"{ex}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -734,7 +744,7 @@ namespace Serein.NodeFlow.Env
|
||||
/// </summary>
|
||||
/// <param name="assemblyName"></param>
|
||||
/// <returns></returns>
|
||||
public bool RemoteDll(string assemblyName)
|
||||
public bool UnloadLibrary(string assemblyName)
|
||||
{
|
||||
return FlowLibraryManagement.UnloadLibrary(assemblyName);
|
||||
|
||||
|
||||
@@ -278,9 +278,9 @@ namespace Serein.NodeFlow.Env
|
||||
}
|
||||
|
||||
|
||||
public void LoadDll(string dllPath)
|
||||
public void LoadLibrary(string dllPath)
|
||||
{
|
||||
currentFlowEnvironment.LoadDll(dllPath);
|
||||
currentFlowEnvironment.LoadLibrary(dllPath);
|
||||
}
|
||||
|
||||
public void LoadProject(FlowEnvInfo flowEnvInfo, string filePath)
|
||||
@@ -307,9 +307,9 @@ namespace Serein.NodeFlow.Env
|
||||
}
|
||||
|
||||
|
||||
public bool RemoteDll(string assemblyName)
|
||||
public bool UnloadLibrary(string assemblyName)
|
||||
{
|
||||
return currentFlowEnvironment.RemoteDll(assemblyName);
|
||||
return currentFlowEnvironment.UnloadLibrary(assemblyName);
|
||||
}
|
||||
|
||||
public async Task<bool> RemoveConnectInvokeAsync(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType)
|
||||
|
||||
@@ -397,13 +397,13 @@ namespace Serein.NodeFlow.Env
|
||||
Console.WriteLine("远程环境尚未实现的接口:ExitRemoteEnv");
|
||||
}
|
||||
|
||||
public void LoadDll(string dllPath)
|
||||
public void LoadLibrary(string dllPath)
|
||||
{
|
||||
// 将dll文件发送到远程环境,由远程环境进行加载
|
||||
Console.WriteLine("远程环境尚未实现的接口:LoadDll");
|
||||
}
|
||||
|
||||
public bool RemoteDll(string assemblyName)
|
||||
public bool UnloadLibrary(string assemblyName)
|
||||
{
|
||||
// 尝试移除远程环境中的加载了的依赖
|
||||
Console.WriteLine("远程环境尚未实现的接口:RemoteDll");
|
||||
|
||||
Reference in New Issue
Block a user