本文整理匯總了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 ()));
}