JavascriptMethodHandler DelegateAwesomium.NET 1.7.6Awesomium.NET
Represents a method that will handle calls to one or more custom Javascript methods, synchronously.

Namespace: Awesomium.Core
Assembly: Awesomium.Core (in Awesomium.Core.dll) Version: 1.7.6.0
Syntax

public delegate JSValue JavascriptMethodHandler(
	Object sender,
	JavascriptMethodEventArgs e
)

Parameters

sender
Type: SystemObject
The source of the event.
e
Type: Awesomium.CoreJavascriptMethodEventArgs
An JavascriptMethodEventArgs that contains the event data.

Return Value

Type: JSValue
A JSValue encapsulating the response that will be sent to JavaScript. This can also be a Local JSObject with custom properties.
Remarks

This delegate is used with Bind(JavascriptMethodHandler), Bind(String, JavascriptMethodHandler) and in DLR to tell the JSObject to create a custom method that returns a value, therefore called synchronously.

The limitations of a synchronous handler are:

  • You cannot make synchronous invocations from inside a synchronous handler.
  • You cannot pass JavaScript objects to a synchronous handler.
For more details, read:
Note Note
A JavascriptMethodHandler method is always called in a synchronous  Javascript Execution Context (JEC). Read this article for details about Javascript Execution Contexts.
Note Note
If Cancel is set to true, any value returned from a JavascriptMethodHandler is ignored and the method call will return Undefined.
Note Note
To create a method that is called asynchronously, use the JavascriptAsyncMethodHandler delegate.
See Also

Reference