MetadataHelper Class
Definition
Section titled “Definition”Helper class to use for retrieving metadata about a plugin, defined as attributes.
public static class MetadataHelper
Inheritance object
Methods
Section titled “Methods”GetMetadata(Type)
Section titled “GetMetadata(Type)”Retrieves the BepInPlugin metadata from a plugin type.
public static BepInPlugin GetMetadata(Type pluginType)
Parameters
Section titled “Parameters”pluginType
Type
The plugin type.
Returns
Section titled “Returns”BepInPlugin
The BepInPlugin metadata of the plugin type.
GetMetadata(object)
Section titled “GetMetadata(object)”Retrieves the BepInPlugin metadata from a plugin instance.
public static BepInPlugin GetMetadata(object plugin)
Parameters
Section titled “Parameters”plugin
object
The plugin instance.
Returns
Section titled “Returns”BepInPlugin
The BepInPlugin metadata of the plugin instance.
GetAttributes(Type)
Section titled “GetAttributes(Type)”Gets the specified attributes of a type, if they exist.
public static T[] GetAttributes<T>(Type pluginType) where T : Attribute
Parameters
Section titled “Parameters”pluginType
Type
The plugin type.
Returns
Section titled “Returns”T[]
The attributes of the type, if existing.
GetAttributes(Assembly)
Section titled “GetAttributes(Assembly)”Gets the specified attributes of an assembly, if they exist.
public static T[] GetAttributes<T>(Assembly assembly) where T : Attribute
Parameters
Section titled “Parameters”assembly
Assembly
The assembly.
Returns
Section titled “Returns”T[]
The attributes of the type, if existing.
GetAttributes(object)
Section titled “GetAttributes(object)”Gets the specified attributes of an instance, if they exist.
public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute
Parameters
Section titled “Parameters”plugin
object
The plugin instance.
Returns
Section titled “Returns”IEnumerable<T>
The attributes of the instance, if existing.
GetAttributes(MemberInfo)
Section titled “GetAttributes(MemberInfo)”Gets the specified attributes of a reflection metadata type, if they exist.
public static T[] GetAttributes<T>(MemberInfo member) where T : Attribute
Parameters
Section titled “Parameters”member
MemberInfo
The reflection metadata instance.
Returns
Section titled “Returns”T[]
The attributes of the instance, if existing.
GetDependencies(Type)
Section titled “GetDependencies(Type)”Retrieves the dependencies of the specified plugin type.
public static IEnumerable<BepInDependency> GetDependencies(Type plugin)
Parameters
Section titled “Parameters”plugin
Type
The plugin type.
Returns
Section titled “Returns”IEnumerable<BepInDependency>
A list of all plugin types that the specified plugin type depends upon.