Exemplo n.º 1
0
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            var lang = LanguageManager.GetLanguages(Sitecore.Context.Database)
                       .FirstOrDefault(x => x.CultureInfo.Equals(culture)) ?? LanguageManager.DefaultLanguage;

            var db   = Sitecore.Context.Database;
            var item = db.GetItem(_path, lang);

            ResourceSet rs = null;

            if (ResourceSets.Contains(culture.Name))
            {
                rs = ResourceSets[culture.Name] as ResourceSet;
            }
            else if (_dictionary)
            {
                rs = new DictionaryResourceSet(item);
                ResourceSets.Add(culture.Name, rs);
            }
            else
            {
                rs = new ItemResourceSet(item);
            }

            return(rs);
        }
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            var lang = LanguageManager.GetLanguages(Sitecore.Context.Database)
                          .FirstOrDefault(x => x.CultureInfo.Equals(culture)) ?? LanguageManager.DefaultLanguage;

            var db = Sitecore.Context.Database;
            var item = db.GetItem(_path, lang);

            ResourceSet rs = null;

            if (ResourceSets.Contains(culture.Name))
            {
                rs = ResourceSets[culture.Name] as ResourceSet;
            }
            else if (_dictionary)
            {
                rs = new DictionaryResourceSet(item);
                ResourceSets.Add(culture.Name, rs);
            }
            else
            {
                rs = new ItemResourceSet(item);
            }

            return rs;
        }