Beispiel #1
0
 public void Initialize(ITypeSystemContext context)
 {
     context.EvaluateJavascript(Scripts.Io);
     var io = new JsrIoInterop(context);
     context.RegisterInteropObject("$jsr_interop$jsr$io$internal", io);
     context.EvaluateJavascript("jsr.register_namespace('jsr.io.internal', $jsr_interop$jsr$io$internal);");
 }
Beispiel #2
0
        public void RegisterTypeSystem(ITypeSystemContext context, ITypeSystemExtension typeSystem)
        {
            var interoperableTypeSystem = typeSystem as IInteroperableTypeSystem;
            if (interoperableTypeSystem == null)
            {
                return;
            }

            var interopObject = interoperableTypeSystem.CreateInteropObject(context);
            var hiddenObjectName = GenerateHiddenObjectName(interopObject);
            _context.SetParameter(hiddenObjectName, interopObject.Object);
            EvaluateJavascript(string.Format("jsr.register_namespace(\"{0}\", {1});", interopObject.Namespace, hiddenObjectName));
        }
Beispiel #3
0
 public InteropObject CreateInteropObject(ITypeSystemContext context)
 {
     return new JsrHttpInterop().ToInteropObject("jsr.http");
 }
Beispiel #4
0
 public void Initialize(ITypeSystemContext context)
 {
 }
Beispiel #5
0
 public InteropObject CreateInteropObject(ITypeSystemContext context)
 {
     return new JsrConsoleInterop().ToInteropObject("jsr.con");
 }
Beispiel #6
0
 public JsrIoInterop(ITypeSystemContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public void Initialize(ITypeSystemContext context)
 {
     context.EvaluateJavascript(Scripts.Json);
 }
Beispiel #8
0
 public InteropObject CreateInteropObject(ITypeSystemContext context)
 {
     return new JsrAppInterop(context).ToInteropObject("jsr.app");
 }
Beispiel #9
0
 public JsrAppInterop([NotNull] ITypeSystemContext context)
 {
     _context = context;
 }