|
@@ -106,16 +106,6 @@ namespace BepInEx
|
|
|
public static class MetadataHelper
|
|
|
{
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public static BepInPlugin GetMetadata(object plugin)
|
|
|
- {
|
|
|
- return GetMetadata(plugin.GetType());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -131,15 +121,12 @@ namespace BepInEx
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
- public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute
|
|
|
- {
|
|
|
- return GetAttributes<T>(plugin.GetType());
|
|
|
- }
|
|
|
+
|
|
|
+ public static BepInPlugin GetMetadata(object plugin)
|
|
|
+ => GetMetadata(plugin.GetType());
|
|
|
|
|
|
|
|
|
|
|
@@ -147,12 +134,21 @@ namespace BepInEx
|
|
|
|
|
|
|
|
|
|
|
|
- public static IEnumerable<T> GetAttributes<T>(Type pluginType) where T : Attribute
|
|
|
+ public static T[] GetAttributes<T>(Type pluginType) where T : Attribute
|
|
|
{
|
|
|
- return pluginType.GetCustomAttributes(typeof(T), true).Cast<T>();
|
|
|
+ return (T[])pluginType.GetCustomAttributes(typeof(T), true);
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute
|
|
|
+ => GetAttributes<T>(plugin.GetType());
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|