public override void SetXsltContext(XsltContext context)
{
if (context == null)
{
throw XPathException.Create(SR.Xp_NoContext);
}
if (this.xsltContext != context)
{
xsltContext = context;
foreach (Query argument in _args)
{
argument.SetXsltContext(context);
}
XPathResultType[] argTypes = new XPathResultType[_args.Count];
for (int i = 0; i < _args.Count; i++)
{
argTypes[i] = _args[i].StaticType;
}
_function = xsltContext.ResolveFunction(prefix, name, argTypes);
// KB article allows to return null, see http://support.microsoft.com/?kbid=324462#6
if (_function == null)
{
throw XPathException.Create(SR.Xp_UndefFunc, QName);
}
}
}