Here are the examples of the csharp api System.Reflection.Emit.ILGenerator.EmitLoadArgument(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : ILGeneratorExtensions.cs
with MIT License
from Sergio0694
with MIT License
from Sergio0694
public static void EmitLoadArgumentForMemberRead(this ILGenerator il, int index, MemberInfo member)
{
switch (member)
{
case FieldInfo _:
il.EmitLoadArgument(index);
break;
case PropertyInfo _:
if (member.DeclaringType.IsValueType) il.EmitLoadArgumentAddress(index);
else il.EmitLoadArgument(index);
break;
default: throw new ArgumentException($"The input {member.GetType()} instance can't be read");
}
}
19
Source : ILGeneratorExtensions.cs
with MIT License
from Sergio0694
with MIT License
from Sergio0694
public static void EmitLoadArgument<T>(this ILGenerator il, T index) where T : Enum => il.EmitLoadArgument((int)(object)index);