public void CastArguments(IList <QilNode> args, string name, XPathQilFactory f)
{
CheckArity(this.minArgs, this.maxArgs, name, args.Count);
// Convert arguments to the appropriate types
if (maxArgs == Infinity)
{
// Special case for concat() function
for (int i = 0; i < args.Count; i++)
{
args[i] = f.ConvertToType(XmlTypeCode.String, args[i]);
}
}
else
{
for (int i = 0; i < args.Count; i++)
{
if (argTypes[i] == XmlTypeCode.Node && f.CannotBeNodeSet(args[i]))
{
throw new XPathCompileException(SR.XPath_NodeSetArgumentExpected, name, (i + 1).ToString(CultureInfo.InvariantCulture));
}
args[i] = f.ConvertToType(argTypes[i], args[i]);
}
}
}