Click or drag to resize

IJsFunction Interface

A JavaScript function that can be passed between .NET and JavaScript as a method argument or a return value. The function lifetime is bound to the lifetime of the frame this function belongs to. When the owner frame is unloaded, all the JavaScript objects are automatically disposed. An attempt to access a disposed JavaScript object will result in ObjectDisposedException

Namespace:  DotNetBrowser.Js
Assembly:  DotNetBrowser (in DotNetBrowser.dll) Version: 2.12.0
Syntax
C#
public interface IJsFunction : IJsObject, 
	IAutoDisposable

The IJsFunction type exposes the following members.

Properties
  NameDescription
Public propertyFrame
Gets the IFrame instance this JavaScript object is bound to.
(Inherited from IJsObject.)
Public propertyIsDisposed
Indicates if the object is already disposed.
(Inherited from IAutoDisposable.)
Public propertyProperties
Gets the object properties as a live collection. Modifying this collection will lead to updating the object properties.
(Inherited from IJsObject.)
Top
Methods
  NameDescription
Public methodInvoke(IJsObject, Object)
Executes the function on the given jsObject with the args. This method blocks current thread execution until the function finishes its execution. If the function raises an exception, then JsException with an error message that describes the reason of the exception will be thrown. Same error message will be printed in JavaScript Console.
Public methodInvokeT(String, Object)
Executes the function with the given methodName and the args in the JavaScript object. This method blocks current thread execution until the function finishes its execution. If the function raises an exception, then a JsException with an error message that describes the reason of the exception will be thrown. Same error message will be printed in JavaScript Console.
(Inherited from IJsObject.)
Public methodInvokeT(IJsObject, Object)
Executes the function on the given jsObject with the args. This method blocks current thread execution until the function finishes its execution. If the function raises an exception, then a JsException with an error message that describes the reason of the exception will be thrown. Same error message will be printed in JavaScript Console.
Top
Events
  NameDescription
Public eventDisposed
Occurs when the object has been disposed.
(Inherited from IAutoDisposable.)
Top
Extension Methods
  NameDescription
Public Extension MethodToJsonString
Converts the given JavaScript object into a JSON string.
(Defined by JsonExtensions.)
Top
Remarks

This API is available since DotNetBrowser 2.1.

See Also