Method Invoke
- Namespace
- DotNetBrowser.Js
- Assembly
- DotNetBrowser.dll
Invoke<T>(string, params 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.
T Invoke<T>(string methodName, params object[] args)
Parameters
methodName
stringThe function name.
args
object[]the list of input arguments. The following types are supported: bool, double, string, IJsObject, or object.
Returns
- T
The result of the JavaScript function execution.
Type Parameters
T
The expected type of the result of the JavaScript function execution
Exceptions
- JsException
The JavaScript function raised an exception.
- ObjectDisposedException
The IJsObject has already been disposed.
- ConnectionClosedException
The connection to the Chromium engine is closed.
Invoke(string, params 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 JsException with an error
message that describes the reason of the exception will be thrown. Same error message will be
printed in JavaScript Console.
object Invoke(string methodName, params object[] args)
Parameters
methodName
stringThe function name.
args
object[]the list of input arguments. The following types are supported: bool, double, string, IJsObject, or object.
Returns
- object
The result of the JavaScript function execution.
Exceptions
- JsException
The JavaScript function raised an exception.
- ObjectDisposedException
The IJsObject has already been disposed.
- ConnectionClosedException
The connection to the Chromium engine is closed.