Skip to content

Commit

Permalink
RegisterCpp2IlPluginAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Dec 28, 2023
1 parent 9a63bf7 commit 8f959e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Cpp2IL.Core/Attributes/RegisterCpp2IlPluginAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ namespace Cpp2IL.Core.Attributes;
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public class RegisterCpp2IlPluginAttribute : Attribute
{
#if NET6_0
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
public Type PluginType { get; }

public RegisterCpp2IlPluginAttribute(Type pluginType)
public RegisterCpp2IlPluginAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type pluginType)
{
if (!typeof(Cpp2IlPlugin).IsAssignableFrom(pluginType))
throw new ArgumentException("Plugin type to register must extend Cpp2IlPlugin", nameof(pluginType));
Expand All @@ -22,4 +20,4 @@ public RegisterCpp2IlPluginAttribute(Type pluginType)

PluginType = pluginType;
}
}
}

0 comments on commit 8f959e1

Please sign in to comment.