LoadTimezoneFromUserData() public static method

Loads the timezone from the current user's data.
public static LoadTimezoneFromUserData ( ) : int?
return int?
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }