/// <summary> /// Creates a new <see cref="JsBinding"/> instance. /// </summary> public JsBinding(JsContextScope scope, JsBinder binder, JsInterop interop, JavaScriptValue value) { _scope = scope; _binder = binder; _interop = interop; _value = value; }
/// <summary> /// Creates a new <see cref="JsCallback"/> instance. /// </summary> public JsCallback(JsExecutionContext context, JsContextScope scope, JsInterop interop, JavaScriptValue callback) { _context = context; _scope = scope; _interop = interop; _callback = callback; _callback.AddRef(); }
/// <summary> /// Creates a new <see cref="JsModule"/> instance. /// </summary> public JsModule(JsContextScope scope, JsBinder binder, JsInterop interop, string moduleId) { _scope = scope; _binder = binder; _interop = interop; ModuleId = moduleId; // Create JS Representation Module = _scope.Run(() => { var jsValue = JavaScriptValue.CreateObject(); jsValue.AddRef(); return(new JsBinding(_scope, _binder, _interop, jsValue)); }); }
/// <summary> /// Creates a new <see cref="JsInterop"/> instance. /// </summary> /// <param name="scope"></param> public JsInterop(JsExecutionContext context, JsContextScope scope, JsBinder binder) { _context = context; _scope = scope; _binder = binder; }
/// <summary> /// Creates a new <see cref="JsBinder"/> instance. /// </summary> public JsBinder(JsContextScope scope) { _scope = scope; _objects = new JsObjectCache(scope); _jsGcCollect = JsGcCollect; }
/// <summary> /// Creates a new <see cref="JsObjectCache"/> instance. /// </summary> public JsObjectCache(JsContextScope scope) { _scope = scope; _objects = new ConditionalWeakTable <object, JsValueHolder>(); }
/// <summary> /// Creates a new safe handle for the JS Value. /// </summary> public JsValueHolder(JavaScriptValue value, JsContextScope scope) : base(value.Reference, true) { _value = value; _value.AddRef(); }
/// <summary> /// Creates a new <see cref="JsBindingBuilder"/> instance. /// </summary> public JsBindingBuilder(JsContextScope scope, JsBinder binder, JsInterop interop) { _scope = scope; _binder = binder; _interop = interop; }