本文整理汇总了C#中Mono.Cecil.GenericInstanceMethod.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GenericInstanceMethod.ToString方法的具体用法?C# GenericInstanceMethod.ToString怎么用?C# GenericInstanceMethod.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.GenericInstanceMethod
的用法示例。
在下文中一共展示了GenericInstanceMethod.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetGenericMethod
private MethodReference GetGenericMethod (GenericInstanceMethod genericInstanceMethod)
{
string value = Method.GetLabel (this, genericInstanceMethod);
if (this.methodsDictionary.ContainsKey (value))
return this.methodsDictionary [value].MethodDefinition;
foreach (Method method in this.methods) {
if (!method.IsGenericType)
continue;
if (method.Name != genericInstanceMethod.Name)
continue;
if (method.MethodDefinition.Parameters.Count != genericInstanceMethod.Parameters.Count)
continue;
bool ok = true;
for (int i = 0; i < method.MethodDefinition.Parameters.Count; i++) {
if (method.MethodDefinition.Parameters [i].ParameterType != genericInstanceMethod.Parameters [i].ParameterType) {
if (!(method.MethodDefinition.Parameters [i].ParameterType is GenericParameter)
|| !(genericInstanceMethod.Parameters [i].ParameterType is GenericParameter)) {
ok = false;
break;
}
}
}
if (ok) {
this.methodsDictionary [value] = method;
return method.MethodDefinition;
}
}
throw new EngineException (string.Format ("Method '{0}' not found.", genericInstanceMethod.ToString ()));
}