예제 #1
0
        /// <summary>
        /// Enabled the languages.
        /// </summary>
        /// <returns>IQueryable{CultureInfo}.</returns>
        public IQueryable <CultureInfo> EnabledLanguages()
        {
            if (_cacheRepository.EnabledLanguages().Any())
            {
                return(_cacheRepository.EnabledLanguages());
            }

            var _repository = _repositoryFactory.GetRepositoryInstance();

            return(GetLocalizationsEnumerable(_repository).Where(l => !string.IsNullOrWhiteSpace(l.LanguageCode))
                   .Select(l => new CultureInfo(l.LanguageCode)).AsQueryable());
        }
        private void SendCulturesToShell()
        {
            var cultures = _elementRepository.EnabledLanguages().ToList();
            var msg      = new GenericEvent <Tuple <List <CultureInfo>, Action <string> > > {
                Message = new Tuple <List <CultureInfo>, Action <string> >(cultures, DoChangeCulture)
            };

            EventSystem.Publish(msg);
        }
예제 #3
0
 public IQueryable <System.Globalization.CultureInfo> EnabledLanguages()
 {
     return(inner.EnabledLanguages());
 }