/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.2
src/OneScriptDocumenter/Primary/AssemblyLoader.cs
40 строк
1 KB
EvilBeaver
Новый документер для нового сайта
30 апр 2025, 00:08
30 апр 2025, 00:08
d0d65e0
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Reflection; namespace OneScriptDocumenter.Primary { public class AssemblyLoader : IDisposable { //private readonly HashSet<AssemblyLoadContext> _loadContexts = new HashSet<AssemblyLoadContext>(); public Dictionary<string, Assembly> LoadAssemblies(IReadOnlyCollection<string> assemblyPaths) { var assemblies = new Dictionary<string, Assembly>(); foreach (var assemblyPath in assemblyPaths) { var context = new DocumentableLibraryLoadContext(assemblyPath); //_loadContexts.Add(context); var assembly = context.LoadFromAssemblyPath(assemblyPath); assemblies.Add(assembly.GetName().Name!, assembly); } return assemblies; } public void Dispose() { // foreach (var loadContext in _loadContexts) // { // loadContext.Unload(); // } } } }