本文整理汇总了C#中IMethod.GetMethodBody方法的典型用法代码示例。如果您正苦于以下问题:C# IMethod.GetMethodBody方法的具体用法?C# IMethod.GetMethodBody怎么用?C# IMethod.GetMethodBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethod
的用法示例。
在下文中一共展示了IMethod.GetMethodBody方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMethodDecorator
private static SynthesizedMethodDecorator GetMethodDecorator(IMethod m, IEnumerable<object> code, IList<object> tokenResolutions, IList<IType> locals, IList<IType> parameters)
{
return new SynthesizedMethodDecorator(
m,
new SynthesizedMethodBodyDecorator(m.GetMethodBody(), locals, Transform(code).ToArray()),
parameters,
new SynthesizedModuleResolver(m, tokenResolutions));
}
示例2: OpCodes
/// <summary>
/// </summary>
/// <param name="method">
/// </param>
/// <param name="genericContext">
/// </param>
/// <param name="stackCall">
/// </param>
/// <returns>
/// </returns>
public IEnumerable<OpCodePart> OpCodes(IMethod method, IGenericContext genericContext, Queue<IMethod> stackCall = null)
{
if (method == null)
{
yield break;
}
foreach (var opCode in this.OpCodes(method.GetMethodBody(), method.Module, genericContext, stackCall))
{
yield return opCode;
}
}
示例3: GetMethodDecorator
public static SynthesizedMethodDecorator GetMethodDecorator(
IMethod m,
byte[] code,
IList<object> tokenResolutions,
IList<IType> locals,
IList<IParameter> parameters)
{
return new SynthesizedMethodDecorator(
m,
new SynthesizedMethodBodyDecorator(m != null ? m.GetMethodBody() : null, locals, code),
parameters,
new SynthesizedModuleResolver(m, tokenResolutions));
}