JSCollectionExtensions.AsDictionary<TValue> method (1 of 2)
Creates a dictionary adapter for properties of a JS object, without copying.
C#
public static IDictionary<string, TValue> AsDictionary<TValue>(this JSObject obj,
To<TValue> valueFromJS, From<TValue> valueToJS)
Remarks
This method must be called from the JS thread. The returned dictionary object is thread-safe and may be accessed from threads other than the JS thread (though accessing from the JS thread is more efficient).
See Also
- struct JSObject
- delegate To<T>
- delegate From<T>
- class JSCollectionExtensions
- namespace Microsoft.JavaScript.NodeApi.Interop
JSCollectionExtensions.AsDictionary<TKey,TValue> method (2 of 2)
Creates a dictionary adapter for a JS Map object, without copying.
C#
public static IDictionary<TKey, TValue> AsDictionary<TKey, TValue>(this JSMap map,
To<TKey> keyFromJS, To<TValue> valueFromJS, From<TKey> keyToJS, From<TValue> valueToJS)
Remarks
This method must be called from the JS thread. The returned dictionary object is thread-safe and may be accessed from threads other than the JS thread (though accessing from the JS thread is more efficient).
See Also
- struct JSMap
- delegate To<T>
- delegate From<T>
- class JSCollectionExtensions
- namespace Microsoft.JavaScript.NodeApi.Interop