本文整理汇总了C#中MosaMethod.GetMethodSig方法的典型用法代码示例。如果您正苦于以下问题:C# MosaMethod.GetMethodSig方法的具体用法?C# MosaMethod.GetMethodSig怎么用?C# MosaMethod.GetMethodSig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MosaMethod
的用法示例。
在下文中一共展示了MosaMethod.GetMethodSig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveMethod
private void ResolveMethod(MosaMethod method)
{
GenericArgumentResolver resolver = new GenericArgumentResolver();
bool hasOpening = method.DeclaringType.HasOpenGenericParams;
if (method.DeclaringType.GenericArguments.Count > 0)
{
foreach (var i in method.DeclaringType.GenericArguments.GetGenericArguments())
hasOpening |= i.HasOpenGenericParameter();
resolver.PushTypeGenericArguments(method.DeclaringType.GenericArguments.GetGenericArguments());
}
if (method.GenericArguments.Count > 0)
{
foreach (var i in method.GenericArguments.GetGenericArguments())
hasOpening |= i.HasOpenGenericParameter();
resolver.PushMethodGenericArguments(method.GenericArguments.GetGenericArguments());
}
else
hasOpening |= method.GetMethodSig().HasOpenGenericParameter();
using (var mosaMethod = metadata.Controller.MutateMethod(method))
{
var desc = method.GetUnderlyingObject<UnitDesc<MethodDef, MethodSig>>();
MosaType returnType = metadata.Loader.GetType(resolver.Resolve(desc.Signature.RetType));
List<MosaParameter> pars = new List<MosaParameter>();
Debug.Assert(desc.Signature.GetParamCount() == desc.Definition.ParamDefs.Count);
for (int i = 0; i < desc.Definition.ParamDefs.Count; i++)
{
pars.Add(new MosaParameter(desc.Definition.ParamDefs[i].FullName, metadata.Loader.GetType(resolver.Resolve(desc.Signature.Params[i]))));
}
mosaMethod.Signature = new MosaMethodSignature(returnType, pars);
if (desc.Definition.HasBody)
ResolveBody(desc.Definition, mosaMethod, desc.Definition.Body, resolver);
mosaMethod.HasOpenGenericParams = hasOpening;
ResolveCustomAttributes(mosaMethod, desc.Definition);
}
}