示例#1
0
        /// <summary>
        /// Retrieve the settings from the user's roaming profile.
        /// </summary>
        /// <returns></returns>
        public static Settings Load()
        {
            var instance = new Settings();

            var settings_ = ApplicationData.Current.RoamingSettings;

            // load settings - a null value means the setting will have an appropriate default value

            var charset = settings_.Values[DefaultCharsetSettingName] as String;
            if (charset != null)
            {
                Charset parsed;
                if (Enum.TryParse<Charset>(charset, out parsed))
                    instance.defaultCharset_ = parsed;
            }

            return instance;
        }
示例#2
0
 public SettingsService()
 {
     settings_ = Settings.Load();
 }