コード例 #1
0
 private NKSNKRemotingContext(NKScriptContextRemotingProxy proxy, Dictionary <string, object> options) : base(proxy.NKid)
 {
     _async_queue  = null;
     this._proxy   = proxy;
     proxy.context = this;
     NKLogging.log("+NodeKit Renderer Remoting JavaScript Proxy E" + _id);
 }
コード例 #2
0
        public static Task <NKScriptContext> createContext(NKScriptContextRemotingProxy proxy, Dictionary <string, object> options)
        {
            if (options == null)
            {
                options = new Dictionary <string, object>();
            }

            NKScriptContext context = new NKSNKRemotingContext(proxy, options);

            return(Task.FromResult(context));
        }
コード例 #3
0
        private async Task startNodeKitRenderer(Dictionary<string, object> options)
        {
            string[] args = (string[])options["NKS.Args"];

            NKEventEmitter.isMainProcess = false;

            options.set("NKS.MainThreadScheduler", TaskScheduler.FromCurrentSynchronizationContext());
            options.set("NKS.MainThreadId", Environment.CurrentManagedThreadId);
            options.set("NKS.RemoteProcess", true);

            proxy = NKRemoting.NKRemotingProxy.registerAsClient(args[0]);
            context = await NKScripting.Engines.NKRemoting.NKSNKRemotingContext.createContext(proxy, options);

            // REMOTE SCRIPT ENGINE LOADED, ADD {NK} NODEKIT PROXY
            await NKElectro.Main.addElectroRemoteProxy(context, options);

            proxy.NKready();
        }
コード例 #4
0
        private async Task startNodeKitRenderer(Dictionary <string, object> options)
        {
            string[] args = (string[])options["NKS.Args"];

            NKEventEmitter.isMainProcess = false;

            options.set("NKS.MainThreadScheduler", TaskScheduler.FromCurrentSynchronizationContext());
            options.set("NKS.MainThreadId", Environment.CurrentManagedThreadId);
            options.set("NKS.RemoteProcess", true);

            proxy   = NKRemoting.NKRemotingProxy.registerAsClient(args[0]);
            context = await NKScripting.Engines.NKRemoting.NKSNKRemotingContext.createContext(proxy, options);

            // REMOTE SCRIPT ENGINE LOADED, ADD {NK} NODEKIT PROXY
            await NKElectro.Main.addElectroRemoteProxy(context, options);

            proxy.NKready();
        }