JavaScriptEngineSwitcher.ChakraCore.JsRt.JsValue.SetProperty C# (CSharp) Метод

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

Sets an object's property
Requires an active script context.
public SetProperty ( JsPropertyId id, JsValue value, bool useStrictRules ) : void
id JsPropertyId The ID of the property
value JsValue The new value of the property
useStrictRules bool The property set should follow strict mode rules
Результат void
		public void SetProperty(JsPropertyId id, JsValue value, bool useStrictRules)
		{
			JsErrorHelpers.ThrowIfError(NativeMethods.JsSetProperty(this, id, value, useStrictRules));
		}

Usage Example

Пример #1
0
        private static void SetNonEnumerableProperty(JsValue objValue, string name, JsValue value)
        {
            JsValue descriptorValue = JsValue.CreateObject();

            descriptorValue.SetProperty("enumerable", JsValue.False, true);
            descriptorValue.SetProperty("writable", JsValue.True, true);

            JsPropertyId id = JsPropertyId.FromString(name);

            objValue.DefineProperty(id, descriptorValue);
            objValue.SetProperty(id, value, true);
        }
All Usage Examples Of JavaScriptEngineSwitcher.ChakraCore.JsRt.JsValue::SetProperty