/// <summary> /// Register the custom function specified, overriding any previous functions with the same details. /// </summary> /// <param name="prefix">The function prefix.</param> /// <param name="name">The function name.</param> /// <param name="customFunction">The custom function implementation.</param> public void RegisterCustomFunction(string prefix, string name, OPathCustomFunction customFunction) { string customFunctionKey = OPathXsltContextFunction.GetCustomFunctionKey(prefix, name); m_CustomFunctions[customFunctionKey] = customFunction; }
/// <summary> /// When overridden in a derived class, resolves a function reference and returns an /// <see cref="T:System.Xml.Xsl.IXsltContextFunction"/> representing the function. The /// <see cref="T:System.Xml.Xsl.IXsltContextFunction"/> is used at execution time to get the return /// value of the function. /// </summary> /// <param name="prefix">The prefix of the function as it appears in the XPath expression.</param> /// <param name="name">The name of the function.</param> /// <param name="ArgTypes">An array of argument types for the function being resolved. This allows /// you to select between methods with the same name (for example, overloaded methods).</param> /// <returns> /// An <see cref="T:System.Xml.Xsl.IXsltContextFunction"/> representing the function. /// </returns> public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] ArgTypes) { IXsltContextFunction function = new OPathXsltContextFunction(prefix, name); return(function); }