public InjectionScriptEngine(InjectionHost injection, IConsole scriptOutput)
 {
     this.injection            = injection;
     this.scriptOutput         = scriptOutput;
     this.fileWatcher.Changed += ScriptFileChanged;
     timer = new System.Timers.Timer(1000)
     {
         AutoReset = true
     };
     timer.Elapsed += (timerElapsedSender, timerElapsedArgs) =>
     {
         lock (currentFileLock)
         {
             if (fileChanged)
             {
                 timer.Stop();
                 try
                 {
                     ExecuteScript(currentFileName, new CancellationTokenSource()).Wait();
                 }
                 finally
                 {
                     timer.Start();
                     fileChanged = false;
                 }
             }
         }
     };
     timer.Start();
 }
 public void Open(InjectionRuntime runtime, InjectionApiUO injectionApi, Legacy infusionApi, InjectionHost host)
 => InjectionWindow.Open(runtime, injectionApi, infusionApi, host);
 public static void Open(InjectionRuntime runtime, InjectionApiUO injectionApi, Legacy infusionApi, InjectionHost host)
 => Open(new InjectionObjectServices(runtime.Objects, injectionApi, infusionApi), new ScriptServices(runtime, host), new MainServices(infusionApi, host),
         new InjectionConfiguration(infusionApi.Config, host.InjectionOptions));
Esempio n. 4
0
 public MainServices(Legacy infusionApi, InjectionHost injectionHost)
 {
     this.infusionApi   = infusionApi;
     this.injectionHost = injectionHost;
 }