Skip to content

JSReference.Run method (1 of 2)

Runs an action with the referenced value, using the JSSynchronizationContext associated with the reference to switch to the JS thread (if necessary) while operating on the value.

C#
public void Run(Action<JSValue> action)

Exceptions

exceptioncondition
ObjectDisposedExceptionThe reference is disposed.
NullReferenceExceptionThe reference is weak and the value is not available.

Remarks

This method may be called from any thread. The action delegate is invoked on the JS thread.

See Also


JSReference.Run<T> method (2 of 2)

Runs an action with the referenced value, using the JSSynchronizationContext associated with the reference to switch to the JS thread (if necessary) while operating on the value.

C#
public T Run<T>(Func<JSValue, T> action)

Exceptions

exceptioncondition
ObjectDisposedExceptionThe reference is disposed.
NullReferenceExceptionThe reference is weak and the value is not available.

Remarks

This method may be called from any thread. The action delegate is invoked on the JS thread.

See Also

Released under the MIT license