示例#1
0
 internal InjectionApiUO(IApiBridge bridge, InjectionApi injectionApi, Metadata metadata, Globals globals, ITimeSource timeSource)
 {
     this.bridge       = bridge;
     this.injectionApi = injectionApi;
     this.globals      = globals;
     Register(metadata);
     random          = new Random();
     this.timeSource = timeSource;
 }
        public InjectionRuntime(IApiBridge bridge, IDebuggerServer debuggerServer, ITimeSource timeSource, Func <CancellationToken?> retrieveCancellationToken)
        {
            paths = new Paths(() => Path.GetDirectoryName(CurrentScript.FileName));

            Api = new InjectionApi(bridge, Metadata, State, timeSource, paths);
            RegisterNatives();
            this.bridge                    = bridge;
            this.debuggerServer            = debuggerServer;
            this.timeSource                = timeSource;
            this.retrieveCancellationToken = retrieveCancellationToken;

            CurrentScript = new ScriptFile("<empty>", string.Empty, null);
            interpreter   = new ThreadLocal <Interpreter>(()
                                                          => new Interpreter(Metadata, CurrentScript.FileName, debuggerServer.Create(), retrieveCancellationToken));
        }
示例#3
0
 public void Initialize()
 {
     timeSource   = new TestTimeSource();
     injectionApi = new InjectionScript.Runtime.InjectionApi(null, new Metadata(), new Globals(), timeSource);
 }
示例#4
0
 public void Initialize()
 {
     timeSource   = new TestTimeSource();
     injectionApi = new InjectionScript.Runtime.InjectionApi(null, new Metadata(), new Globals(), timeSource,
                                                             new Paths(() => string.Empty), new Objects());
 }
示例#5
0
 public InjectionRuntime(IApiBridge bridge, IDebuggerServer debuggerServer, ITimeSource timeSource)
 {
     interpreter = new ThreadLocal <Interpreter>(() => new Interpreter(Metadata, CurrentFileName, debuggerServer.Create()));
     Api         = new InjectionApi(bridge, Metadata, Globals, timeSource);
     RegisterNatives();
 }