JSObject ClassAwesomium.NET 1.7.6Awesomium.NET
Represents an Object type in JavaScript. You can add, set, get, and remove named Properties and invoke named Methods.
Inheritance Hierarchy

SystemObject
  Awesomium.CoreViewModel
    Awesomium.CoreNativeViewModel
      Awesomium.CoreJSObject
        Awesomium.CoreJSFunction
        Awesomium.CoreJSPropertyDescriptor

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

public class JSObject : NativeViewModel, IDynamicObject, 
	IDynamicMetaObjectProvider, IEnumerable<string>, IEnumerable, IConvertible

The JSObject type exposes the following members.

Constructors

  NameDescription
Public methodJSObject
Creates a Local JavaScript object.
Protected methodCode exampleJSObject(JSObject)
Constructor implemented by inheritors to support restoration of a local JSObject that has been passed to V8, back to the initial managed type.
Top
Methods

  NameDescription
Public methodCode exampleBind(JavascriptMethodHandler)
Creates a custom method that returns a value, and binds it to a JavascriptMethodHandler delegate.
Public methodCode exampleBind(JSFunctionHandler)
Creates a custom method that returns a value, and binds it to a JSFunctionHandler delegate.
Public methodCode exampleBind(String, JavascriptMethodHandler)
Creates a custom method that returns a value, and binds it to a JavascriptMethodHandler delegate.
Public methodCode exampleBind(String, JSFunctionHandler)
Creates a custom method that returns a value, and binds it to a JSFunctionHandler delegate.
Public methodBindAsync(JavascriptAsyncMethodHandler)
Creates a custom method that is called asynchronously, and binds it to a JavascriptAsyncMethodHandler delegate.
Public methodBindAsync(JSFunctionAsyncHandler)
Creates a custom method that is called asynchronously, and binds it to a JSFunctionAsyncHandler delegate.
Public methodBindAsync(String, JavascriptAsyncMethodHandler)
Creates a custom method that is called asynchronously, and binds it to a JavascriptAsyncMethodHandler delegate.
Public methodBindAsync(String, JSFunctionAsyncHandler)
Creates a custom method that is called asynchronously, and binds it to a JSFunctionAsyncHandler delegate.
Public methodClone
Creates a copy of this JSObject instance.
Public methodDispose
Destroys and releases this JSObject instance.
(Overrides NativeViewModelDispose.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Overrides ObjectEquals(Object).)
Protected methodFinalize (Overrides NativeViewModelFinalize.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Public methodGetLastError
Gets the latest error that may have occurred.
Public methodGetMethodNames
Gets an array of names of this object's methods.
Public methodGetPropertyDescriptor
Gets a JSPropertyDescriptor instance representing the property descriptor of a JavaScript object's property.
Public methodCode exampleGetPropertyNames
Gets an array of names of this object's properties.
Public methodCode exampleHasMethod
Gets if this object has a method with the specified name.
Public methodCode exampleHasProperty
Gets if this object has a property with the specified name.
Public methodInvoke
Invokes a method with a set of arguments and returns a result.
Public methodInvokeAsync
Invoke a method asynchronously with a set of arguments, ignoring the result.
Protected methodOnDispose
Called when an instance of this class is being disposed.
(Overrides NativeViewModelOnDispose.)
Protected methodOnPropertyChanged
Triggers the PropertyChanged event.
(Inherited from ViewModel.)
Protected methodRaisePropertyChanged
Helper method to raise the PropertyChanged event.
(Inherited from ViewModel.)
Public methodRemoveProperty
Removes the property with the specified name, if any.
Public methodToString
Gets the textual representation of the object.
(Overrides ObjectToString.)
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Tests whether two JSObject instances represent the same Javascript objects.
Public operatorStatic member(JSObject to Boolean)
Implicitly converts a JSObject to a Boolean value.
Public operatorStatic memberInequality
Tests whether two JSObject instances represent different Javascript objects.
Top
Properties

  NameDescription
Public propertyGlobalObjectName
Gets the name of the remote global object.

Only valid if this is a global JavaScript object created with CreateGlobalJavascriptObject(String) (see Type).

Public propertyIsDisposed
Gets if this JSObject instance has been disposed.
(Overrides NativeViewModelIsDisposed.)
Public propertyIsUndefined
Gets if this is an invalid object, equivalent to Undefined.
Public propertyOwner
Get this object's owning IWebView instance.
Public propertyCode examplePropertyString
Gets or sets the value of the specified named property.
Public propertyPropertyString, JSPropertyDescriptor
Gets or sets the value of the specified named data property.
Public propertyCode examplePropertyString, Boolean
Gets or sets the value of the specified named property.
Public propertyPropertyString, Boolean, JSPropertyDescriptor
Gets or sets the value of the specified named data property.
Public propertyRemoteId
Get the remote identifier for this JSObject instance (will be 0 if this object is of type Local).
Public propertyType
Gets this object's type.
Top
Events

  NameDescription
Public eventDisposed
Occurs when an instance of this class has been disposed.
(Inherited from NativeViewModel.)
Public eventPropertyChanged
Occurs when the value of a property of this class, has changed.
(Inherited from ViewModel.)
Top
Remarks

There are two major types of JSObjects, Local and Remote. Local objects only have Properties and can be accessed without error in the main process. Users can only create Local objects. Remote objects are defined within the V8 engine in a separate process and can have both Properties and Methods.

Method calls on Remote objects are proxied to the process and execute synchronously or asynchronously. Those executed synchronously, may fail for various reasons (see: GetLastError).

JSObject supports the Dynamic Language Runtime (DLR). This allows flexible coding, much similar to Javascript (which is a dynamic language).

Users can create a subclass of a JSObject to construct local objects with an interface that reflects standard features of the object. For details, read the documentation of JSObject(JSObject).

For details about JSObjects, read Introduction to JavaScript Integration.

Thread Safety

Static members of this type are not safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
See Also

Reference

Other Resources