/// <summary> /// Initializes a new instance of the <see cref="ResourceLocalizationProvider"/> class. /// </summary> public ResourceLocalizationProvider(IComposerEnvironment environment, ICacheProvider cacheProvider) { if (environment == null) { throw new ArgumentNullException(nameof(environment)); } CacheProvider = cacheProvider ?? throw new ArgumentNullException(nameof(cacheProvider)); VirtualPathProvider = environment.VirtualPathProvider; LocalizationRepository = new ResxLocalizationRepository(environment); }
public ResxLocalizationRepository(IComposerEnvironment environment) { if (environment == null) { throw new ArgumentNullException("environment"); } _virtualPathProvider = environment.VirtualPathProvider; _regexSource = new Regex(ComposerConfiguration.ResxLocalizationRepositoryConfiguration.RegexSource, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase); EnsureResxDirectoryExists(ComposerConfiguration.ResxLocalizationRepositoryConfiguration.LocalizationResxDirectory); }
private ComposerHost(bool autoCrawlEnabled, params _Assembly[] assembliesToInclude) { AutoCrawlEnabled = autoCrawlEnabled; AssembliesToInclude = assembliesToInclude ?? new _Assembly[0]; if (!AutoCrawlEnabled && !AssembliesToInclude.Any()) { throw new ArgumentException("The constructor you used does not support Auto crawling of assemblies and you didn't define any assemblies to include."); } _dependencyContainer = new AutofacDependencyContainer(); _aspNetConfigurationManager = new AspNetConfigurationManager(); _assemblyHelper = new AssemblyHelper(); _appDomainAssemblies = new Dictionary <string, _Assembly>(); _environment = new ComposerEnvironment(); }
internal void SetComposerEnvironment(IComposerEnvironment environment) { _environment = environment; }