Class JsMethodManager

The core JS Method Manager.

JS methods allow the user agent to invoke .NET methods

Inheritance
JsMethodManager
Namespace: VoltstroStudios.UnityWebBrowser.Core.Js
Assembly: .dll
Syntax
[Serializable]
public sealed class JsMethodManager

Fields

| Edit this page View Source

jsMethodsEnable

Enables/Disables JS Methods

Declaration
public bool jsMethodsEnable
Field Value
TypeDescription
bool

Methods

| Edit this page View Source

RegisterJsMethod(string, MethodInfo, object)

Registers a method to be able to be invoked by JS

Declaration
public void RegisterJsMethod(string name, MethodInfo methodInfo, object target)
Parameters
TypeNameDescription
stringname

Name of the method

MethodInfomethodInfo

The MethodInfo of the method

objecttarget

Target object that the method lives on

Exceptions
TypeCondition
NotEnabledException

Thrown if jsMethodsEnable is false

ArgumentNullException

Thrown if name, methodInfo or target are null or empty

ArgumentException

Thrown if the name has already been used

UnsupportedTypeException

Thrown if the method returns anything other then void