Exemplo n.º 1
0
        private static List <Literal> ResourceManager(string locale)
        {
            if (!SupportedLanguage.Contains(locale))
            {
                locale = DefaultLanguage;
            }

            if (_resourceManager != null)
            {
                return(_resourceManager);
            }

            var manifestResourceStream = Assembly.Load(new AssemblyName("PodcastRadio.Core")).GetManifestResourceStream(string.Format($"PodcastRadio.Core.Language.Resources-{locale}.json"));
            var streamReader           = new StreamReader(manifestResourceStream);
            var jsonString             = streamReader.ReadToEnd();
            var tracksCollection       = JsonConvert.DeserializeObject <List <Literal> >(jsonString);

            _resourceManager = tracksCollection;
            return(_resourceManager);
        }