/// <summary>Gets or sets script variable values.</summary> /// <param name="index">The name of the variable.</param> /// <returns>The variable value.</returns> public void setJsVariable(string global, object value) { NitroScriptEngine nse = NitroEngine; if (nse != null) { nse[global] = value; } }
/// <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 object RunLiteral(string name, object context, object[] args, bool optional) { NitroScriptEngine nse = NitroEngine; if (nse != null) { return(nse.RunLiteral(name, context, args, optional)); } return(null); }
/// <summary>Gets or sets script variable values.</summary> /// <param name="index">The name of the variable.</param> /// <returns>The variable value.</returns> public object getJsVariable(string global) { NitroScriptEngine nse = NitroEngine; if (nse != null) { return(nse[global]); } return(null); }