Exemplo n.º 1
0
        /// <inheritdoc />
        public IJsExecutionContext NewExecutionContext()
        {
            var engine           = new Engine(_configure);
            var executionContext = new JsExecutionContext(engine);

            engine.ClrTypeConverter.RegisterDelegateConversion(
                typeof(IJsCallback),
                new JsCallbackConversion(executionContext));

            return(executionContext);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new <see cref="JsCallbackConversion"/> instance.
 /// </summary>
 public JsCallbackConversion(JsExecutionContext executionContext)
 {
     _executionContext = executionContext;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new <see cref="JsCallback"/> instance.
 /// </summary>
 public JsCallback(JsExecutionContext context, Func <JsValue, JsValue[], JsValue> callback)
 {
     _context  = context;
     _callback = callback;
 }