C# Класс MsieJavaScriptEngine.JsRt.Edge.EdgeJsValue

“Edge” JavaScript value
The JavaScript value is one of the following types of values: Undefined, Null, Boolean, String, Number, or Object.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddRef ( ) : uint

Adds a reference to the object

This only needs to be called on objects that are not going to be stored somewhere on the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed until Release is called.

CallFunction ( ) : EdgeJsValue

Invokes a function

Requires an active script context.

ConstructObject ( ) : EdgeJsValue

Invokes a function as a constructor

Requires an active script context.

ConvertToBoolean ( ) : EdgeJsValue

Converts a value to Boolean using regular JavaScript semantics

Requires an active script context.

ConvertToNumber ( ) : EdgeJsValue

Converts a value to Number using regular JavaScript semantics

Requires an active script context.

ConvertToObject ( ) : EdgeJsValue

Converts a value to Object using regular JavaScript semantics

Requires an active script context.

ConvertToString ( ) : EdgeJsValue

Converts a value to String using regular JavaScript semantics

Requires an active script context.

CreateArray ( uint length ) : EdgeJsValue

Creates a JavaScript array object

Requires an active script context.

CreateError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript error object

Requires an active script context.

CreateExternalObject ( IntPtr data, JsObjectFinalizeCallback finalizer ) : EdgeJsValue

Creates a new Object that stores some external data

Requires an active script context.

CreateFunction ( EdgeJsNativeFunction function ) : EdgeJsValue

Creates a new JavaScript function

Requires an active script context.

CreateFunction ( EdgeJsNativeFunction function, IntPtr callbackData ) : EdgeJsValue

Creates a new JavaScript function

Requires an active script context.

CreateObject ( ) : EdgeJsValue

Creates a new Object

Requires an active script context.

CreateRangeError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript RangeError error object

Requires an active script context.

CreateReferenceError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript ReferenceError error object

Requires an active script context.

CreateSyntaxError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript SyntaxError error object

Requires an active script context.

CreateTypeError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript TypeError error object

Requires an active script context.

CreateUriError ( EdgeJsValue message ) : EdgeJsValue

Creates a new JavaScript URIError error object

Requires an active script context.

DefineProperty ( EdgeJsPropertyId propertyId, EdgeJsValue propertyDescriptor ) : bool

Defines a new object's own property from a property descriptor

Requires an active script context.

DeleteIndexedProperty ( EdgeJsValue index ) : void

Delete a value at the specified index of an object

Requires an active script context.

DeleteProperty ( EdgeJsPropertyId propertyId, bool useStrictRules ) : EdgeJsValue

Deletes a object's property

Requires an active script context.

Equals ( EdgeJsValue other ) : bool

Compare two JavaScript values for equality

This function is equivalent to the "==" operator in JavaScript.

Requires an active script context.

FromBoolean ( bool value ) : EdgeJsValue

Creates a Boolean value from a bool value

Requires an active script context.

FromDouble ( double value ) : EdgeJsValue

Creates a Number value from a double value

Requires an active script context.

FromInt32 ( int value ) : EdgeJsValue

Creates a Number value from a int value

Requires an active script context.

FromObject ( object value ) : EdgeJsValue

Creates a JavaScript value that is a projection of the passed in object

Requires an active script context.

FromString ( string value ) : EdgeJsValue

Creates a String value from a string pointer

Requires an active script context.

GetIndexedProperty ( EdgeJsValue index ) : EdgeJsValue

Retrieve a value at the specified index of an object

Requires an active script context.

GetOwnPropertyDescriptor ( EdgeJsPropertyId propertyId ) : EdgeJsValue

Gets a property descriptor for an object's own property

Requires an active script context.

GetOwnPropertyNames ( ) : EdgeJsValue

Gets a list of all properties on the object

Requires an active script context.

GetProperty ( EdgeJsPropertyId id ) : EdgeJsValue

Gets a object's property

Requires an active script context.

HasIndexedProperty ( EdgeJsValue index ) : bool

Test if an object has a value at the specified index

Requires an active script context.

HasProperty ( EdgeJsPropertyId propertyId ) : bool

Determines whether an object has a property

Requires an active script context.

PreventExtension ( ) : void

Sets a object to not be extensible

Requires an active script context.

Release ( ) : uint

Releases a reference to the object

Removes a reference that was created by AddRef.

SetIndexedProperty ( EdgeJsValue index, EdgeJsValue value ) : void

Sets a value at the specified index of an object

Requires an active script context.

SetProperty ( EdgeJsPropertyId id, EdgeJsValue value, bool useStrictRules ) : void

Sets a object's property

Requires an active script context.

StrictEquals ( EdgeJsValue other ) : bool

Compare two JavaScript values for strict equality

This function is equivalent to the "===" operator in JavaScript.

Requires an active script context.

ToBoolean ( ) : bool

Retrieves a bool value of a Boolean value

Requires an active script context.

ToDouble ( ) : double

Retrieves a double value of a Number value

This function retrieves the value of a Number value. It will fail with InvalidArgument if the type of the value is not Number.

Requires an active script context.

ToObject ( ) : object

Retrieves a object representation of an Object value

Requires an active script context.

ToString ( ) : string

Retrieves a string pointer of a String value

This function retrieves the string pointer of a String value. It will fail with InvalidArgument if the type of the value is not String.

Requires an active script context.

Приватные методы

Метод Описание
EdgeJsValue ( IntPtr reference ) : System

Initializes a new instance of the EdgeJsValue struct.

Описание методов

AddRef() публичный Метод

Adds a reference to the object
This only needs to be called on objects that are not going to be stored somewhere on the stack. Calling AddRef ensures that the JavaScript object the value refers to will not be freed until Release is called.
public AddRef ( ) : uint
Результат uint

CallFunction() публичный Метод

Invokes a function
Requires an active script context.
public CallFunction ( ) : EdgeJsValue
Результат EdgeJsValue

ConstructObject() публичный Метод

Invokes a function as a constructor
Requires an active script context.
public ConstructObject ( ) : EdgeJsValue
Результат EdgeJsValue

ConvertToBoolean() публичный Метод

Converts a value to Boolean using regular JavaScript semantics
Requires an active script context.
public ConvertToBoolean ( ) : EdgeJsValue
Результат EdgeJsValue

ConvertToNumber() публичный Метод

Converts a value to Number using regular JavaScript semantics
Requires an active script context.
public ConvertToNumber ( ) : EdgeJsValue
Результат EdgeJsValue

ConvertToObject() публичный Метод

Converts a value to Object using regular JavaScript semantics
Requires an active script context.
public ConvertToObject ( ) : EdgeJsValue
Результат EdgeJsValue

ConvertToString() публичный Метод

Converts a value to String using regular JavaScript semantics
Requires an active script context.
public ConvertToString ( ) : EdgeJsValue
Результат EdgeJsValue

CreateArray() публичный статический Метод

Creates a JavaScript array object
Requires an active script context.
public static CreateArray ( uint length ) : EdgeJsValue
length uint The initial length of the array
Результат EdgeJsValue

CreateError() публичный статический Метод

Creates a new JavaScript error object
Requires an active script context.
public static CreateError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

CreateExternalObject() публичный статический Метод

Creates a new Object that stores some external data
Requires an active script context.
public static CreateExternalObject ( IntPtr data, JsObjectFinalizeCallback finalizer ) : EdgeJsValue
data System.IntPtr External data that the object will represent. May be null
finalizer JsObjectFinalizeCallback The callback for when the object is finalized. May be null.
Результат EdgeJsValue

CreateFunction() публичный статический Метод

Creates a new JavaScript function
Requires an active script context.
public static CreateFunction ( EdgeJsNativeFunction function ) : EdgeJsValue
function EdgeJsNativeFunction The method to call when the function is invoked
Результат EdgeJsValue

CreateFunction() публичный статический Метод

Creates a new JavaScript function
Requires an active script context.
public static CreateFunction ( EdgeJsNativeFunction function, IntPtr callbackData ) : EdgeJsValue
function EdgeJsNativeFunction The method to call when the function is invoked
callbackData System.IntPtr Data to be provided to all function callbacks
Результат EdgeJsValue

CreateObject() публичный статический Метод

Creates a new Object
Requires an active script context.
public static CreateObject ( ) : EdgeJsValue
Результат EdgeJsValue

CreateRangeError() публичный статический Метод

Creates a new JavaScript RangeError error object
Requires an active script context.
public static CreateRangeError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

CreateReferenceError() публичный статический Метод

Creates a new JavaScript ReferenceError error object
Requires an active script context.
public static CreateReferenceError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

CreateSyntaxError() публичный статический Метод

Creates a new JavaScript SyntaxError error object
Requires an active script context.
public static CreateSyntaxError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

CreateTypeError() публичный статический Метод

Creates a new JavaScript TypeError error object
Requires an active script context.
public static CreateTypeError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

CreateUriError() публичный статический Метод

Creates a new JavaScript URIError error object
Requires an active script context.
public static CreateUriError ( EdgeJsValue message ) : EdgeJsValue
message EdgeJsValue Message for the error object
Результат EdgeJsValue

DefineProperty() публичный Метод

Defines a new object's own property from a property descriptor
Requires an active script context.
public DefineProperty ( EdgeJsPropertyId propertyId, EdgeJsValue propertyDescriptor ) : bool
propertyId EdgeJsPropertyId The ID of the property
propertyDescriptor EdgeJsValue The property descriptor
Результат bool

DeleteIndexedProperty() публичный Метод

Delete a value at the specified index of an object
Requires an active script context.
public DeleteIndexedProperty ( EdgeJsValue index ) : void
index EdgeJsValue The index to delete
Результат void

DeleteProperty() публичный Метод

Deletes a object's property
Requires an active script context.
public DeleteProperty ( EdgeJsPropertyId propertyId, bool useStrictRules ) : EdgeJsValue
propertyId EdgeJsPropertyId The ID of the property
useStrictRules bool The property set should follow strict mode rules
Результат EdgeJsValue

Equals() публичный Метод

Compare two JavaScript values for equality

This function is equivalent to the "==" operator in JavaScript.

Requires an active script context.

public Equals ( EdgeJsValue other ) : bool
other EdgeJsValue The object to compare
Результат bool

FromBoolean() публичный статический Метод

Creates a Boolean value from a bool value
Requires an active script context.
public static FromBoolean ( bool value ) : EdgeJsValue
value bool The value to be converted
Результат EdgeJsValue

FromDouble() публичный статический Метод

Creates a Number value from a double value
Requires an active script context.
public static FromDouble ( double value ) : EdgeJsValue
value double The value to be converted
Результат EdgeJsValue

FromInt32() публичный статический Метод

Creates a Number value from a int value
Requires an active script context.
public static FromInt32 ( int value ) : EdgeJsValue
value int The value to be converted
Результат EdgeJsValue

FromObject() публичный статический Метод

Creates a JavaScript value that is a projection of the passed in object
Requires an active script context.
public static FromObject ( object value ) : EdgeJsValue
value object The object to be projected
Результат EdgeJsValue

FromString() публичный статический Метод

Creates a String value from a string pointer
Requires an active script context.
public static FromString ( string value ) : EdgeJsValue
value string The string to convert to a String value
Результат EdgeJsValue

GetIndexedProperty() публичный Метод

Retrieve a value at the specified index of an object
Requires an active script context.
public GetIndexedProperty ( EdgeJsValue index ) : EdgeJsValue
index EdgeJsValue The index to retrieve
Результат EdgeJsValue

GetOwnPropertyDescriptor() публичный Метод

Gets a property descriptor for an object's own property
Requires an active script context.
public GetOwnPropertyDescriptor ( EdgeJsPropertyId propertyId ) : EdgeJsValue
propertyId EdgeJsPropertyId The ID of the property
Результат EdgeJsValue

GetOwnPropertyNames() публичный Метод

Gets a list of all properties on the object
Requires an active script context.
public GetOwnPropertyNames ( ) : EdgeJsValue
Результат EdgeJsValue

GetProperty() публичный Метод

Gets a object's property
Requires an active script context.
public GetProperty ( EdgeJsPropertyId id ) : EdgeJsValue
id EdgeJsPropertyId The ID of the property
Результат EdgeJsValue

HasIndexedProperty() публичный Метод

Test if an object has a value at the specified index
Requires an active script context.
public HasIndexedProperty ( EdgeJsValue index ) : bool
index EdgeJsValue The index to test
Результат bool

HasProperty() публичный Метод

Determines whether an object has a property
Requires an active script context.
public HasProperty ( EdgeJsPropertyId propertyId ) : bool
propertyId EdgeJsPropertyId The ID of the property
Результат bool

PreventExtension() публичный Метод

Sets a object to not be extensible
Requires an active script context.
public PreventExtension ( ) : void
Результат void

Release() публичный Метод

Releases a reference to the object
Removes a reference that was created by AddRef.
public Release ( ) : uint
Результат uint

SetIndexedProperty() публичный Метод

Sets a value at the specified index of an object
Requires an active script context.
public SetIndexedProperty ( EdgeJsValue index, EdgeJsValue value ) : void
index EdgeJsValue The index to set
value EdgeJsValue The value to set
Результат void

SetProperty() публичный Метод

Sets a object's property
Requires an active script context.
public SetProperty ( EdgeJsPropertyId id, EdgeJsValue value, bool useStrictRules ) : void
id EdgeJsPropertyId The ID of the property
value EdgeJsValue The new value of the property
useStrictRules bool The property set should follow strict mode rules
Результат void

StrictEquals() публичный Метод

Compare two JavaScript values for strict equality

This function is equivalent to the "===" operator in JavaScript.

Requires an active script context.

public StrictEquals ( EdgeJsValue other ) : bool
other EdgeJsValue The object to compare
Результат bool

ToBoolean() публичный Метод

Retrieves a bool value of a Boolean value
Requires an active script context.
public ToBoolean ( ) : bool
Результат bool

ToDouble() публичный Метод

Retrieves a double value of a Number value

This function retrieves the value of a Number value. It will fail with InvalidArgument if the type of the value is not Number.

Requires an active script context.

public ToDouble ( ) : double
Результат double

ToObject() публичный Метод

Retrieves a object representation of an Object value
Requires an active script context.
public ToObject ( ) : object
Результат object

ToString() публичный Метод

Retrieves a string pointer of a String value

This function retrieves the string pointer of a String value. It will fail with InvalidArgument if the type of the value is not String.

Requires an active script context.

public ToString ( ) : string
Результат string