private void Initialize() { if (!_initialized) { _js = _jsRuntimeProvider.GetInstance(); _js.Initialize(); _js.LoadLibrary(Utility.ResourceAsString(CompilerLibraryResourceName, this.GetType())); _initialized = true; } }
protected virtual void Dispose(bool disposing) { if (disposing) { if (_js != null) { _js.Dispose(); _js = null; } } }
protected virtual void Dispose(bool disposing) { if (disposing) { if (js != null) { js.Dispose(); js = null; } } }
/// <summary> /// Compiles the TypeScript /// </summary> /// <param name="engine"></param> /// <param name="typeScript"></param> /// <returns></returns> internal string CompileTypeScript(IJavaScriptRuntime engine, string typeScript) { using (engine) { var result = engine.ExecuteFunction <string>("compileTsSource", typeScript, JsLibs.lib_d); if (TypeScriptCompilationErrorParser.HasErrors(result)) { throw new TypeScriptCompilationException(TypeScriptCompilationErrorParser.Parse(result).ToArray()); } return(result); } }
/// <summary> /// Compiles the TypeScript /// </summary> /// <param name="engine"></param> /// <param name="typeScript"></param> /// <returns></returns> internal string CompileTypeScript(IJavaScriptRuntime engine, string typeScript) { using (engine) { var result = engine.ExecuteFunction<string>("compileTsSource", typeScript, JsLibs.lib_d); if (TypeScriptCompilationErrorParser.HasErrors(result)) { throw new TypeScriptCompilationException(TypeScriptCompilationErrorParser.Parse(result).ToArray()); } return result; } }
private void Initialize() { if (!initialized) { js = jsRuntimeProvider.Value; js.Initialize(); foreach (var resource in CompilerLibraryResourceNames) { js.LoadLibrary(ReadEmbeddedResource(resource, GetType())); } initialized = true; } }