Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 /// <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();
 }
Beispiel #3
0
        /// <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));
            });
        }
Beispiel #4
0
 /// <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;
 }
Beispiel #5
0
 /// <summary>
 /// Creates a new <see cref="JsBinder"/> instance.
 /// </summary>
 public JsBinder(JsContextScope scope)
 {
     _scope       = scope;
     _objects     = new JsObjectCache(scope);
     _jsGcCollect = JsGcCollect;
 }
Beispiel #6
0
 /// <summary>
 /// Creates a new <see cref="JsObjectCache"/> instance.
 /// </summary>
 public JsObjectCache(JsContextScope scope)
 {
     _scope   = scope;
     _objects = new ConditionalWeakTable <object, JsValueHolder>();
 }
Beispiel #7
0
 /// <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();
 }
Beispiel #8
0
 /// <summary>
 /// Creates a new <see cref="JsBindingBuilder"/> instance.
 /// </summary>
 public JsBindingBuilder(JsContextScope scope, JsBinder binder, JsInterop interop)
 {
     _scope   = scope;
     _binder  = binder;
     _interop = interop;
 }