protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            Language = Request.UserLanguages == null ? "en" : Request.UserLanguages[0];
            ViewBag.language = Language;

            Thread.CurrentThread.CurrentCulture = new CultureInfo(Language);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(Language);

            Settings = StrongSettings.GetSettings(db.Settings.ToList());
            ViewBag.settings = Settings;
        }
Exemple #2
0
        public static StrongSettings GetSettings(List <Setting> settings)
        {
            var ss = new StrongSettings()
            {
                ShowKeyword            = bool.Parse(settings.Find(x => x.Key == "ShowKeyword").Value ?? bool.TrueString),
                ShowTitle              = bool.Parse(settings.Find(x => x.Key == "ShowTitle").Value ?? bool.TrueString),
                AllowStuntRetry        = bool.Parse(settings.Find(x => x.Key == "AllowStuntRetry").Value ?? bool.TrueString),
                EnableUserRegistration = bool.Parse(settings.Find(x => x.Key == "EnableUserRegistration").Value ?? bool.TrueString),
                EnableTeamRegistration = bool.Parse(settings.Find(x => x.Key == "EnableTeamRegistration").Value ?? bool.TrueString),
                EnableTeamJoining      = bool.Parse(settings.Find(x => x.Key == "EnabledTeamJoining").Value ?? bool.TrueString),
                GuestStuntsVisible     = bool.Parse(settings.Find(x => x.Key == "GuestStuntsVisible").Value ?? bool.TrueString),
                GuestTeamsVisible      = bool.Parse(settings.Find(x => x.Key == "GuestTeamsVisible").Value ?? bool.TrueString),
                GuestSummaryVisible    = bool.Parse(settings.Find(x => x.Key == "GuestSummaryVisible").Value ?? bool.TrueString),
                GuideUrl = settings.Find(x => x.Key == "GuideUrl").Value
            };

            return(ss);
        }
Exemple #3
0
        public static StrongSettings GetSettings(List <Setting> settings)
        {
            Setting defaultEmptySetting = new Setting();
            var     ss = new StrongSettings()
            {
                ShowKeyword            = bool.Parse(settings.FindOrDefault(x => x.Key == "ShowKeyword", defaultEmptySetting).Value ?? bool.TrueString),
                ShowTitle              = bool.Parse(settings.FindOrDefault(x => x.Key == "ShowTitle", defaultEmptySetting).Value ?? bool.TrueString),
                AllowStuntRetry        = bool.Parse(settings.FindOrDefault(x => x.Key == "AllowStuntRetry", defaultEmptySetting).Value ?? bool.TrueString),
                EnableUserRegistration = bool.Parse(settings.FindOrDefault(x => x.Key == "EnableUserRegistration", defaultEmptySetting).Value ?? bool.TrueString),
                EnableTeamRegistration = bool.Parse(settings.FindOrDefault(x => x.Key == "EnableTeamRegistration", defaultEmptySetting).Value ?? bool.TrueString),
                EnableTeamJoining      = bool.Parse(settings.FindOrDefault(x => x.Key == "EnabledTeamJoining", defaultEmptySetting).Value ?? bool.TrueString),
                GuestStuntsVisible     = bool.Parse(settings.FindOrDefault(x => x.Key == "GuestStuntsVisible", defaultEmptySetting).Value ?? bool.TrueString),
                GuestTeamsVisible      = bool.Parse(settings.FindOrDefault(x => x.Key == "GuestTeamsVisible", defaultEmptySetting).Value ?? bool.TrueString),
                GuestSummaryVisible    = bool.Parse(settings.FindOrDefault(x => x.Key == "GuestSummaryVisible", defaultEmptySetting).Value ?? bool.TrueString),
                ScavengerHuntTitle     = settings.FindOrDefault(x => x.Key == "ScavengerHuntTitle", defaultEmptySetting).Value,
                ScavengerHuntTagline   = settings.FindOrDefault(x => x.Key == "ScavengerHuntTagline", defaultEmptySetting).Value,
                DisplayCurrentRankings = bool.Parse(settings.FindOrDefault(x => x.Key == "DisplayCurrentRankings", defaultEmptySetting).Value ?? bool.TrueString),
                DisplayStunts          = bool.Parse(settings.FindOrDefault(x => x.Key == "DisplayStunts", defaultEmptySetting).Value ?? bool.TrueString)
            };

            return(ss);
        }
Exemple #4
0
        public static StrongSettings GetSettings(List<Setting> settings)
        {
            var ss = new StrongSettings()
                         {
                             ShowKeyword = bool.Parse(settings.Find(x => x.Key == "ShowKeyword").Value ?? bool.TrueString),
                             ShowTitle = bool.Parse(settings.Find(x => x.Key == "ShowTitle").Value ?? bool.TrueString),
                             AllowStuntRetry = bool.Parse(settings.Find(x => x.Key == "AllowStuntRetry").Value ?? bool.TrueString),
                             EnableUserRegistration = bool.Parse(settings.Find(x => x.Key == "EnableUserRegistration").Value ?? bool.TrueString),
                             EnableTeamRegistration = bool.Parse(settings.Find(x => x.Key == "EnableTeamRegistration").Value ?? bool.TrueString),
                             EnableTeamJoining = bool.Parse(settings.Find(x => x.Key == "EnabledTeamJoining").Value ?? bool.TrueString),
                             GuestStuntsVisible = bool.Parse(settings.Find(x => x.Key == "GuestStuntsVisible").Value ?? bool.TrueString),
                             GuestTeamsVisible = bool.Parse(settings.Find(x => x.Key == "GuestTeamsVisible").Value ?? bool.TrueString),
                             ScavengerHuntTitle = settings.Find(x => x.Key == "ScavengerHuntTitle").Value,
                             ScavengerHuntTagline = settings.Find(x => x.Key == "ScavengerHuntTagline").Value
                         };

            return ss;
        }