本文整理匯總了C#中System.RuntimeType.GetMemberMethod方法的典型用法代碼示例。如果您正苦於以下問題:C# RuntimeType.GetMemberMethod方法的具體用法?C# RuntimeType.GetMemberMethod怎麽用?C# RuntimeType.GetMemberMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.RuntimeType
的用法示例。
在下文中一共展示了RuntimeType.GetMemberMethod方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ResolveOverloadedMethod
// This will find the right overloaded method if the argValues from soap have type information,
// By default parameters will be of type string, this could lead to a wrong choice of methodbase.
void ResolveOverloadedMethod(RuntimeType t, String methodName, ArrayList argNames, ArrayList argValues)
{
MethodInfo[] mi = t.GetMemberMethod(methodName,
MethodCall.LookupPublic,
CallingConventions.Any,
null,
-1,
false);
if (mi!=null)
{
if (mi.Length == 1)
{
MI = mi[0];
}
else if (mi.Length > 1)
{
for (int i=0; i<mi.Length; i++)
{
ParameterInfo[] piA = mi[i].GetParameters();
bool bMatch = true;
if (piA.Length == argValues.Count)
{
for (int j=0; j<piA.Length; j++)
{
Type ptype = piA[j].ParameterType;
if (ptype.IsByRef)
ptype= ptype.GetElementType();
if (ptype != argValues[j].GetType())
{
bMatch = false;
break;
}
}
if (bMatch)
{
MI = mi[i];
break;
}
}
}
if (MI == null)
{
throw new RemotingException(
Environment.GetResourceString(
"Remoting_AmbiguousMethod"));
}
}
}
}