mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-19 15:51:45 +00:00
Allow multiple [TargetType] and [TargetAssembly] attributes (#1343)
Patch-method discovery already reads both with the plural MetadataHelper.GetAttributes<T>(), and the docs say additional target attributes can be specified, but the attributes lacked AllowMultiple = true, so the compiler rejected a second one (CS0579). Set AllowMultiple = true on both.
This commit is contained in:
1 parent
da64b220eb
commit
5f39645992
1 file changed
+2
-2
@@ -82,7 +82,7 @@ public class PatcherPluginInfoAttribute : Attribute
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines an assembly that a patch method will target.
|
/// Defines an assembly that a patch method will target.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Method)]
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
|
||||||
public class TargetAssemblyAttribute : Attribute
|
public class TargetAssemblyAttribute : Attribute
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -108,7 +108,7 @@ public class TargetAssemblyAttribute : Attribute
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines a type that a patch method will target.
|
/// Defines a type that a patch method will target.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Method)]
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
|
||||||
public class TargetTypeAttribute : Attribute
|
public class TargetTypeAttribute : Attribute
|
||||||
{
|
{
|
||||||
/// <param name="targetAssembly">The short filename of the assembly of which <paramref name="targetType" /> belongs to.</param>
|
/// <param name="targetAssembly">The short filename of the assembly of which <paramref name="targetType" /> belongs to.</param>
|
||||||
|
|||||||
Reference in new issue
Block a user