Esempio n. 1
0
        /// <summary> Returns all strings in the specified culture. </summary>
        /// <param name="includeParentCultures"> </param>
        /// <param name="culture"> The <see cref="CultureInfo" /> to get strings for. </param>
        /// <returns> The strings. </returns>
        protected IEnumerable <LocalizedString> GetAllStrings(bool includeParentCultures, CultureInfo culture)
        {
            if (culture == null)
            {
                throw new ArgumentNullException(nameof(culture));
            }

            var cache = _cultureCacheManager.GetAllAsync(culture.Name).AwaitSynchronously();

            var resourceNames = cache.Select(a => a.Key);

            foreach (var name in resourceNames)
            {
                var value = GetStringSafely(name, culture);

                yield return(new LocalizedString(name, value ?? name, value == null, searchedLocation: "DB"));
            }
        }