コード例 #1
0
 private void Initialize()
 {
     if (!_initialized) {
         _js = _jsRuntimeProvider.GetInstance();
         _js.Initialize();
         _js.LoadLibrary(Utility.ResourceAsString(CompilerLibraryResourceName, this.GetType()));
         _initialized = true;
     }
 }
コード例 #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing) {
         if (_js != null) {
             _js.Dispose();
             _js = null;
         }
     }
 }
コード例 #3
0
 private void Initialize()
 {
     if (!_initialized)
     {
         _js = _jsRuntimeProvider.GetInstance();
         _js.Initialize();
         _js.LoadLibrary(Utility.ResourceAsString(CompilerLibraryResourceName, this.GetType()));
         _initialized = true;
     }
 }
コード例 #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (js != null)
         {
             js.Dispose();
             js = null;
         }
     }
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 /// <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;    
     }
 }
コード例 #7
0
 private void Initialize()
 {
     if (!initialized)
     {
         js = jsRuntimeProvider.Value;
         js.Initialize();
         foreach (var resource in CompilerLibraryResourceNames)
         {
             js.LoadLibrary(ReadEmbeddedResource(resource, GetType()));
         }
         initialized = true;
     }
 }
コード例 #8
0
 private void Initialize()
 {
     if (!initialized)
     {
         js = jsRuntimeProvider.Value;
         js.Initialize();
         foreach (var resource in CompilerLibraryResourceNames)
         {
             js.LoadLibrary(ReadEmbeddedResource(resource, GetType()));
         }
         initialized = true;
     }
 }