예제 #1
0
 public CulturesViewModel Create()
 {
     return(new CulturesViewModel()
     {
         Cultures = CultureManager.GetCultures(this.RequestHandler.Storage).Where(c => !c.IsNeutral).Select(
             c => new CultureViewModelFactory(this.RequestHandler).Create(c)
             )
     });
 }
예제 #2
0
        private void ConstructProperty(ObjectBuilderBase objectBuilder, Object @object, Member member)
        {
            Property property = this.propertyRepository.WithObjectIdAndMemberId(@object.Id, member.Id);
            IDictionary <Culture, Localization> localizationsByCultures = new Dictionary <Culture, Localization>();

            foreach (Culture culture in CultureManager.GetCultures(this.requestHandler.Storage))
            {
                localizationsByCultures.Add(culture, this.localizationRepository.WithDictionaryIdAndCultureId(property.HtmlId, culture.Id));
            }

            objectBuilder.BuildProperty(@object, member, property, localizationsByCultures);
        }
예제 #3
0
        private IDictionary <string, string> GetLocalizationValuesByCultureCodes(Property property)
        {
            Dictionary <string, string> localizationValuesByCultureCodes = new Dictionary <string, string>();

            foreach (Culture culture in CultureManager.GetCultures(this.requestHandler.Storage))
            {
                localizationValuesByCultureCodes.Add(
                    culture.Code,
                    this.localizationRepository.WithDictionaryIdAndCultureId((int)property.StringValueId, culture.Id)?.Value
                    );
            }

            return(localizationValuesByCultureCodes);
        }
예제 #4
0
        private DomainProperty CreateDomainProperty(Property property)
        {
            DomainProperty domainProperty = new DomainProperty();

            if (property != null)
            {
                foreach (Culture culture in CultureManager.GetCultures(this.handler.Storage))
                {
                    Localization localization = this.handler.Storage.GetRepository <ILocalizationRepository>().WithDictionaryIdAndCultureId(property.HtmlId, culture.Id);

                    domainProperty.Add(culture.Code, localization?.Value);
                }
            }

            return(domainProperty);
        }