Прочетете на английски Редактиране

Споделяне чрез


JSObject.SetProperty Method

Definition

Overloads

SetProperty(String, Boolean)

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, Byte[])

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, Double)

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, Int32)

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, JSObject)

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, String)

Defines a new property on the target object, or modifies an existing property to have the specified value.

SetProperty(String, Boolean)

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, bool value);

Parameters

propertyName
String

The name of the property.

value
Boolean

The value of property to set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

SetProperty(String, Byte[])

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, byte[]? value);

Parameters

propertyName
String

The name of the property.

value
Byte[]

The value of property to set.

Remarks

The method will copy the bytes.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

SetProperty(String, Double)

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, double value);

Parameters

propertyName
String

The name of the property.

value
Double

The value of property to set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

SetProperty(String, Int32)

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, int value);

Parameters

propertyName
String

The name of the property.

value
Int32

The value of property to set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

SetProperty(String, JSObject)

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, System.Runtime.InteropServices.JavaScript.JSObject? value);

Parameters

propertyName
String

The name of the property.

value
JSObject

The value of property to set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

SetProperty(String, String)

Defines a new property on the target object, or modifies an existing property to have the specified value.

C#
public void SetProperty(string propertyName, string? value);

Parameters

propertyName
String

The name of the property.

value
String

The value of property to set.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10