Ejemplo n.º 1
0
 public static IServiceCollection AddLanguageContainer <TKeysProvider>(this IServiceCollection services, Assembly assembly, LocalizationFolderType localizationFolderType = LocalizationFolderType.InstallationFolder, string folderName = "Resources")
     where TKeysProvider : KeysProvider
 {
     services.AddSingleton <IKeysProvider, TKeysProvider>(s => (TKeysProvider)Activator.CreateInstance(typeof(TKeysProvider), assembly, folderName, localizationFolderType));
     return(services.AddSingleton <ILanguageContainerService, LanguageContainerInAssembly>(s =>
     {
         var keysProvider = s.GetService <IKeysProvider>();
         return new LanguageContainerInAssembly(keysProvider);
     }));
 }
Ejemplo n.º 2
0
 public ExternalFileKeysProvider(Assembly resourcesAssembly, string resourceFolderName = "Localization", LocalizationFolderType localizationFolderType = LocalizationFolderType.LocalFolder) : base(resourcesAssembly, resourceFolderName)
 {
     LocalizationFolderType = localizationFolderType;
 }