Revamp AssemblyPatcher and patcher plugins

This commit is contained in:
Bepis committed 2021-07-29 10:38:36 +10:00
1 parent 41c8e23e7a
commit 9cc0211a78
11 files changed
+660 -313

No files matched your search

+9
View File
@@ -308,6 +308,15 @@ namespace BepInEx
public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute =>
GetAttributes<T>(plugin.GetType());
/// <summary>
/// Gets the specified attributes of a reflection metadata type, if they exist.
/// </summary>
/// <typeparam name="T">The attribute type to retrieve.</typeparam>
/// <param name="member">The reflection metadata instance.</param>
/// <returns>The attributes of the instance, if existing.</returns>
public static T[] GetAttributes<T>(MemberInfo member) where T : Attribute =>
(T[]) member.GetCustomAttributes(typeof(T), true);
/// <summary>
/// Retrieves the dependencies of the specified plugin type.
/// </summary>