/// <summary>
        /// Intended for testing purposes only.
        /// </summary>
        public SingleFileResourceManagerStringLocalizer(
            ResourceManager resourceManager,
            IResourceStringProvider resourceStringProvider,
            string baseName,
            IResourceNamesCache resourceNamesCache,
            string keyPrefix)
        {
            if (resourceManager == null)
            {
                throw new ArgumentNullException(nameof(resourceManager));
            }

            if (resourceStringProvider == null)
            {
                throw new ArgumentNullException(nameof(resourceStringProvider));
            }

            if (baseName == null)
            {
                throw new ArgumentNullException(nameof(baseName));
            }

            if (resourceNamesCache == null)
            {
                throw new ArgumentNullException(nameof(resourceNamesCache));
            }

            _resourceStringProvider = resourceStringProvider;
            _resourceManager        = resourceManager;
            _resourceBaseName       = baseName;
            _resourceNamesCache     = resourceNamesCache;
            _keyPrefix = keyPrefix;
        }
Пример #2
0
 public AccountController(IAuthenticationManager authenticationManager,
     IApplicationSignInManager applicationSignInManager,
     IResourceStringProvider resourceStringProvider)
 {
     _authenticationManager = authenticationManager;
     _applicationSignInManager = applicationSignInManager;
     _resourceStringProvider = resourceStringProvider;
 }
Пример #3
0
        public DefaultApplication(ILogger logger,
            IDispatcher dispatcher,
            IResourceStringProvider resourceProvider,
            ISetupService setupService)
        {
            if (logger == null) throw new ArgumentNullException(nameof(logger));
            if (dispatcher == null) throw new ArgumentNullException(nameof(dispatcher));
            if (resourceProvider == null) throw new ArgumentNullException(nameof(resourceProvider));
            if (setupService == null) throw new ArgumentNullException(nameof(setupService));

            _logger = logger;
            _dispatcher = dispatcher;
            _resourceProvider = resourceProvider;
            _setupService = setupService;
        }
        /// <summary>
        /// Creates a new <see cref="ResourceManagerWithCultureStringLocalizer"/>.
        /// </summary>
        /// <param name="resourceManager">The <see cref="ResourceManager"/> to read strings from.</param>
        /// <param name="resourceStringProvider">The <see cref="IResourceStringProvider"/> that can find the resources.</param>
        /// <param name="baseName">The base name of the embedded resource that contains the strings.</param>
        /// <param name="resourceNamesCache">Cache of the list of strings for a given resource assembly name.</param>
        /// <param name="culture">The specific <see cref="CultureInfo"/> to use.</param>
        /// <param name="logger">The <see cref="ILogger"/>.</param>
        internal ResourceManagerWithCultureStringLocalizer(
            ResourceManager resourceManager,
            IResourceStringProvider resourceStringProvider,
            string baseName,
            IResourceNamesCache resourceNamesCache,
            CultureInfo culture,
            ILogger logger)
            : base(resourceManager, resourceStringProvider, baseName, resourceNamesCache, logger)
        {
            if (resourceManager == null)
            {
                throw new ArgumentNullException(nameof(resourceManager));
            }

            if (resourceStringProvider == null)
            {
                throw new ArgumentNullException(nameof(resourceStringProvider));
            }

            if (baseName == null)
            {
                throw new ArgumentNullException(nameof(baseName));
            }

            if (resourceNamesCache == null)
            {
                throw new ArgumentNullException(nameof(resourceNamesCache));
            }

            if (culture == null)
            {
                throw new ArgumentNullException(nameof(culture));
            }

            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _resourceBaseName = baseName;
            _culture          = culture;
        }
        /// <summary>
        /// Intended for testing purposes only.
        /// </summary>
        public ResourceManagerStringLocalizer(
            ResourceManager resourceManager,
#pragma warning disable PUB0001 // Pubternal type IResourceStringProvider in public API
            IResourceStringProvider resourceStringProvider,
#pragma warning restore PUB0001 // Pubternal type IResourceStringProvider in public API
            string baseName,
            IResourceNamesCache resourceNamesCache,
            ILogger logger)
        {
            if (resourceManager == null)
            {
                throw new ArgumentNullException(nameof(resourceManager));
            }

            if (resourceStringProvider == null)
            {
                throw new ArgumentNullException(nameof(resourceStringProvider));
            }

            if (baseName == null)
            {
                throw new ArgumentNullException(nameof(baseName));
            }

            if (resourceNamesCache == null)
            {
                throw new ArgumentNullException(nameof(resourceNamesCache));
            }

            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _resourceStringProvider = resourceStringProvider;
            _resourceManager        = resourceManager;
            _resourceBaseName       = baseName;
            _resourceNamesCache     = resourceNamesCache;
            _logger = logger;
        }
Пример #6
0
        /// <summary>
        /// Intended for testing purposes only.
        /// </summary>
        internal ResourceManagerStringLocalizer(
            ResourceManager resourceManager,
            IResourceStringProvider resourceStringProvider,
            string baseName,
            IResourceNamesCache resourceNamesCache,
            ILogger logger)
        {
            if (resourceManager == null)
            {
                throw new ArgumentNullException(nameof(resourceManager));
            }

            if (resourceStringProvider == null)
            {
                throw new ArgumentNullException(nameof(resourceStringProvider));
            }

            if (baseName == null)
            {
                throw new ArgumentNullException(nameof(baseName));
            }

            if (resourceNamesCache == null)
            {
                throw new ArgumentNullException(nameof(resourceNamesCache));
            }

            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _resourceStringProvider = resourceStringProvider;
            _resourceManager        = resourceManager;
            _resourceBaseName       = baseName;
            _resourceNamesCache     = resourceNamesCache;
            _logger = logger;
        }
        /// <summary>
        /// Creates a new <see cref="SingleFileResourceManagerWithCultureStringLocalizer"/>.
        /// </summary>
        /// <param name="resourceManager">The <see cref="ResourceManager"/> to read strings from.</param>
        /// <param name="resourceStringProvider">The <see cref="IResourceStringProvider"/> that can find the resources.</param>
        /// <param name="baseName">The base name of the embedded resource that contains the strings.</param>
        /// <param name="resourceNamesCache">Cache of the list of strings for a given resource assembly name.</param>
        /// <param name="culture">The specific <see cref="CultureInfo"/> to use.</param>
        /// <param name="keyPrefix"></param>
        internal SingleFileResourceManagerWithCultureStringLocalizer(ResourceManager resourceManager, IResourceStringProvider resourceStringProvider, string baseName, IResourceNamesCache resourceNamesCache, CultureInfo culture, string keyPrefix)
            : base(resourceManager, resourceStringProvider, baseName, resourceNamesCache, keyPrefix)
        {
            if (resourceManager == null)
            {
                throw new ArgumentNullException(nameof(resourceManager));
            }

            if (resourceStringProvider == null)
            {
                throw new ArgumentNullException(nameof(resourceStringProvider));
            }

            if (baseName == null)
            {
                throw new ArgumentNullException(nameof(baseName));
            }

            if (resourceNamesCache == null)
            {
                throw new ArgumentNullException(nameof(resourceNamesCache));
            }

            if (culture == null)
            {
                throw new ArgumentNullException(nameof(culture));
            }

            _culture = culture;
        }