INNER CODE UNIT · C#
entryPointTypes
WerWolv/ImHex · plugins/script_loader/support/dotnet/AssemblyLoader/Program.cs:121
var entryPointTypes = Array.FindAll(assembly.GetTypes(), t => t.GetInterface("IScript") != null);
if (entryPointTypes.Length == 0)
{
Log("Failed to find Script entrypoint");
return ResultError;
} else if (entryPointTypes.Length > 1)
{
Log("Found multiple Script entrypoints");
return ResultError;
}
var entryPointType = entryPointTypes[0];
if (type is "EXEC" or "LOAD")
{
// Load the function
var method = entryPointType.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public);