Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindBestMethod()

MethodInfo System.Xml.Xsl.XsltOld.XsltCompileContext.FindBestMethod ( MethodInfo[] methods,
bool ignoreCase,
bool publicOnly,
string name,
XPathResultType[] argTypes )
inlineprivate

Definition at line 504 of file XsltCompileContext.cs.

505 {
506 int num = methods.Length;
507 int num2 = 0;
508 for (int i = 0; i < num; i++)
509 {
510 if (string.Equals(name, methods[i].Name, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) && (!publicOnly || methods[i].GetBaseDefinition().IsPublic))
511 {
512 methods[num2++] = methods[i];
513 }
514 }
515 num = num2;
516 if (num == 0)
517 {
518 return null;
519 }
520 if (argTypes == null)
521 {
522 return methods[0];
523 }
524 num2 = 0;
525 for (int j = 0; j < num; j++)
526 {
527 if (methods[j].GetParameters().Length == argTypes.Length)
528 {
529 methods[num2++] = methods[j];
530 }
531 }
532 num = num2;
533 if (num <= 1)
534 {
535 return methods[0];
536 }
537 num2 = 0;
538 for (int k = 0; k < num; k++)
539 {
540 bool flag = true;
541 ParameterInfo[] parameters = methods[k].GetParameters();
542 for (int l = 0; l < parameters.Length; l++)
543 {
546 {
547 XPathResultType xPathType = GetXPathType(parameters[l].ParameterType);
549 {
550 flag = false;
551 break;
552 }
553 }
554 }
555 if (flag)
556 {
557 methods[num2++] = methods[k];
558 }
559 }
560 num = num2;
561 return methods[0];
562 }
static XPathResultType GetXPathType(Type type)

References System.Xml.Dictionary, System.Xml.Xsl.XsltOld.XsltCompileContext.GetXPathType(), and System.Xml.Name.

Referenced by System.Xml.Xsl.XsltOld.XsltCompileContext.GetExtentionMethod().