/// <summary>Runs a nitro function by name with a set of arguments only if the method exists.</summary> /// <param name="name">The name of the function in lowercase.</param> /// <param name="element">The element to use for the 'this' value.</param> /// <param name="args">The set of arguments to use when calling the function.</param> /// <param name="optional">True if the method call is optional. No exception is thrown if not found.</param> /// <returns>The value that the called function returned, if any.</returns> public object RunLiteral(string name, Element element, object[] args, bool optional) { if (string.IsNullOrEmpty(name) || CodeInstance == null) { return(null); } CodeInstance.This = element; return(CodeInstance.RunLiteral(name, args, optional)); }
/// <summary>Runs a nitro function by name with a set of arguments only if the method exists.</summary> /// <param name="name">The name of the function in lowercase.</param> /// <param name="context">The context to use for the 'this' value.</param> /// <param name="args">The set of arguments to use when calling the function.</param> /// <param name="optional">True if the method call is optional. No exception is thrown if not found.</param> /// <returns>The value that the called function returned, if any.</returns> public override object RunLiteral(string name, object context, object[] args, bool optional) { if (string.IsNullOrEmpty(name) || CodeInstance == null) { return(null); } CodeInstance.This = context as HtmlElement; return(CodeInstance.RunLiteral(name, args, optional)); }