LoadTimezoneFromCookie() публичный статический Метод

Loads the timezone from a cookie.
public static LoadTimezoneFromCookie ( ) : int?
Результат int?
Пример #1
0
        /// <summary>
        /// Loads language and time zone settings.
        /// </summary>
        private void LoadLanguageAndTimezoneSettings()
        {
            // Load hard-stored settings
            // If not available, look for cookie
            // If not available, load defaults

            string culture = Preferences.LoadLanguageFromUserData(currentWiki);

            if (culture == null)
            {
                culture = Preferences.LoadLanguageFromCookie();
            }
            if (culture == null)
            {
                culture = Settings.GetDefaultLanguage(currentWiki);
            }

            string tempTimezone = Preferences.LoadTimezoneFromUserData(currentWiki);

            if (string.IsNullOrEmpty(tempTimezone))
            {
                tempTimezone = Preferences.LoadTimezoneFromCookie();
            }
            if (string.IsNullOrEmpty(tempTimezone))
            {
                tempTimezone = Settings.GetDefaultTimezone(currentWiki);
            }

            languageSelector.SelectedLanguage = culture;
            languageSelector.SelectedTimezone = tempTimezone;
        }
Пример #2
0
        /// <summary>
        /// Loads language and time zone settings.
        /// </summary>
        private void LoadLanguageAndTimezoneSettings()
        {
            // Load hard-stored settings
            // If not available, look for cookie
            // If not available, load defaults

            string culture = Preferences.LoadLanguageFromUserData();

            if (culture == null)
            {
                culture = Preferences.LoadLanguageFromCookie();
            }
            if (culture == null)
            {
                culture = Settings.DefaultLanguage;
            }

            int?tempTimezone = Preferences.LoadTimezoneFromUserData();

            if (!tempTimezone.HasValue)
            {
                tempTimezone = Preferences.LoadTimezoneFromCookie();
            }
            if (!tempTimezone.HasValue)
            {
                tempTimezone = Settings.DefaultTimezone;
            }

            languageSelector.SelectedLanguage = culture;
            languageSelector.SelectedTimezone = tempTimezone.ToString();
        }