コード例 #1
0
        /// <summary>
        /// Apply configuration overrides from web.config (or vcompile.exe.config)
        /// </summary>
        /// <param name="config">The settings from config file</param>
        /// <returns>The builder</returns>
        public CompilerOptionsBuilder ApplyConfigurableOverrides(AspViewConfigurationSection.Model config)
        {
            var overrides = config.CompilerOptions;

            if (overrides.AllowPartiallyTrustedCallers.HasValue)
            {
                AllowPartiallyTrustedCallers(overrides.AllowPartiallyTrustedCallers.Value);
            }

            if (overrides.AutoRecompilation.HasValue)
            {
                AutoRecompilation(overrides.AutoRecompilation.Value);
            }

            if (overrides.Debug.HasValue)
            {
                CompileForDebugging(overrides.Debug.Value);
            }

            if (overrides.SaveFiles.HasValue)
            {
                KeepTemporarySourceFiles(overrides.SaveFiles.Value);
            }

            if (string.IsNullOrEmpty(overrides.TemporarySourceFilesDirectory) == false)
            {
                UsingTemporarySourceFilesDirectory(overrides.TemporarySourceFilesDirectory);
            }

            if (config.Providers != null)
            {
                foreach (var type in config.Providers.Keys)
                {
                    if (type == typeof(IPreCompilationStepsProvider))
                    {
                        PreCompilationStepsProviderIs(config.Providers[type]);
                    }
                    if (type == typeof(IMarkupTransformersProvider))
                    {
                        MarkupTransformersProviderIs(config.Providers[type]);
                    }
                }
            }

            AddReferences(config.References.ToArray());
            return(this);
        }
コード例 #2
0
 public void ApplyConfigurableOverrides(AspViewConfigurationSection.Model options)
 {
     Compiler.ApplyConfigurableOverrides(options);
 }