Exemplo n.º 1
0
        /// <summary>
        /// Loads the code generator on demand
        /// </summary>
        public static void Initialize()
        {
#if !NETSTANDARD_TODO
            codeGeneratorInstance      = LoadCodeGenerator();
            codeGeneratorCacheInstance = codeGeneratorInstance as ICodeGeneratorCache;
#endif
        }
Exemplo n.º 2
0
        /// <summary>
        /// Ensures code for all currently loaded assemblies has been generated and loaded.
        /// </summary>
        public static void GenerateAndCacheCodeForAllAssemblies()
        {
            IRuntimeCodeGenerator codeGen = CodeGeneratorInstance.Value;

            if (codeGen != null)
            {
                codeGen.GenerateAndLoadForAssemblies(AppDomain.CurrentDomain.GetAssemblies());
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Ensures code for the <paramref name="input"/> assembly has been generated and loaded.
        /// </summary>
        /// <param name="input">
        /// The input assembly.
        /// </param>
        public static void GenerateAndCacheCodeForAssembly(Assembly input)
        {
            IRuntimeCodeGenerator codeGen = CodeGeneratorInstance.Value;

            if (codeGen != null)
            {
                codeGen.GenerateAndLoadForAssembly(input);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Loads the code generator.
        /// </summary>
        /// <returns>The code generator.</returns>
        private static IRuntimeCodeGenerator LoadCodeGenerator()
        {
            IRuntimeCodeGenerator result = AssemblyLoader.TryLoadAndCreateInstance<IRuntimeCodeGenerator>(CodeGenAssemblyName, Log);
            if (result == null)
            {
                Log.Warn(
                    ErrorCode.CodeGenDllMissing,
                    "Code generator assembly (" + CodeGenAssemblyName + ".dll) not present.");
            }

            return result;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Loads the code generator.
        /// </summary>
        /// <returns>The code generator.</returns>
        private IRuntimeCodeGenerator LoadCodeGenerator()
        {
            IRuntimeCodeGenerator result = AssemblyLoader.TryLoadAndCreateInstance <IRuntimeCodeGenerator>(CodeGenAssemblyName, Log, this.serviceProvider);

            if (result == null)
            {
                Log.Info(
                    ErrorCode.CodeGenDllMissing,
                    "Code generator assembly (" + CodeGenAssemblyName + ".dll) not present.");
            }

            return(result);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Loads the code generator on demand
 /// </summary>
 public void Initialize()
 {
     this.codeGeneratorInstance = this.serviceProvider.GetService <IRuntimeCodeGenerator>() ?? this.LoadCodeGenerator();
     codeGeneratorCacheInstance = this.codeGeneratorInstance as ICodeGeneratorCache;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Loads the code generator on demand
 /// </summary>
 public static void Initialize()
 {
     codeGeneratorInstance = LoadCodeGenerator();
     codeGeneratorCacheInstance = codeGeneratorInstance as ICodeGeneratorCache;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Loads the code generator on demand
 /// </summary>
 public static void Initialize()
 {
     CodeGeneratorInstance      = LoadCodeGenerator();
     CodeGeneratorCacheInstance = CodeGeneratorInstance as ICodeGeneratorCache;
 }