Click or drag to resize

HostFunctionsfunc Method (Int32, Object)

Creates a delegate that invokes a script function and returns its result value.

Namespace:  Microsoft.ClearScript
Assembly:  ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.5
Syntax
public Object func(
	int argCount,
	Object scriptFunc
)

Parameters

argCount
Type: SystemInt32
The number of arguments to pass to the script function.
scriptFunc
Type: SystemObject
The script function for which to create a delegate.

Return Value

Type: Object
A new delegate that invokes the specified script function and returns its result value.
Remarks

This function creates a delegate that accepts argCount arguments and returns the result of invoking scriptFunc. The type of all parameters and the return value is Object. Such a delegate is often useful in strongly typed contexts because of contravariance.

For information about the types of result values that script code can return, see Evaluate(String, Boolean, String).

See Also