|
@@ -74,16 +74,16 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
public static event AssemblyResolveEventHandler AssemblyResolve;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public static Dictionary<string, List<T>> FindPluginTypes<T>(string directory, Func<TypeDefinition, T> typeSelector, Func<AssemblyDefinition, bool> assemblyFilter = null, string cacheName = null) where T : ICacheable, new()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static Dictionary<string, List<T>> FindPluginTypes<T>(string directory, Func<TypeDefinition, T> typeSelector, Func<AssemblyDefinition, bool> assemblyFilter = null, string cacheName = null) where T : ICacheable, new()
|
|
|
{
|
|
|
var result = new Dictionary<string, List<T>>();
|
|
|
Dictionary<string, CachedAssembly<T>> cache = null;
|
|
@@ -108,18 +108,12 @@ namespace BepInEx.Bootstrap
|
|
|
|
|
|
if (!assemblyFilter?.Invoke(ass) ?? false)
|
|
|
{
|
|
|
+ result[dll] = new List<T>();
|
|
|
ass.Dispose();
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
var matches = ass.MainModule.Types.Select(typeSelector).Where(t => t != null).ToList();
|
|
|
-
|
|
|
- if (matches.Count == 0)
|
|
|
- {
|
|
|
- ass.Dispose();
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
result[dll] = matches;
|
|
|
ass.Dispose();
|
|
|
}
|