Rhino.WrapFactory.WrapAsJavaObject C# (CSharp) Method

WrapAsJavaObject() public method

Wrap Java object as Scriptable instance to allow full access to its methods and fields from JavaScript.
Wrap Java object as Scriptable instance to allow full access to its methods and fields from JavaScript.

Wrap(Context, Scriptable, object, System.Type<T>) and WrapNewObject(Context, Scriptable, object) call this method when they can not convert javaObject to JavaScript primitive value or JavaScript array.

Subclasses can override the method to provide custom wrappers for Java objects.

public WrapAsJavaObject ( Context cx, Scriptable scope, object javaObject, Type staticType ) : Scriptable
cx Context the current Context for this thread
scope Scriptable the scope of the executing script
javaObject object the object to be wrapped
staticType System.Type /// type hint. If security restrictions prevent to wrap /// object based on its class, staticType will be used instead. ///
return Scriptable
		public virtual Scriptable WrapAsJavaObject(Context cx, Scriptable scope, object javaObject, Type staticType)
		{
			return new NativeJavaObject(scope, javaObject, staticType);
		}