当前位置: 首页>>代码示例>>C#>>正文


C# IsolatedStorageSettings.Save方法代码示例

本文整理汇总了C#中System.IO.IsolatedStorage.IsolatedStorageSettings.Save方法的典型用法代码示例。如果您正苦于以下问题:C# IsolatedStorageSettings.Save方法的具体用法?C# IsolatedStorageSettings.Save怎么用?C# IsolatedStorageSettings.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.IsolatedStorage.IsolatedStorageSettings的用法示例。


在下文中一共展示了IsolatedStorageSettings.Save方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteSetting

 /// <summary>
 /// Private helper method for performing deletes on a setting
 /// </summary>
 /// <param name="store">The IsolatedStorageSettings store to use (either "site" or "application")</param>
 /// <param name="key">The key of the object to delete</param>
 private static void DeleteSetting(IsolatedStorageSettings store, string key)
 {
     if(store.Contains(key))
     {
         store.Remove(key);
         store.Save();
     }
 }
开发者ID:Aaronontheweb,项目名称:isolatedstorage-extensions,代码行数:13,代码来源:IsolatedStorageHelper.Settings.cs

示例2: StorageSetting

 //constructor gets settings
 public StorageSetting()
 {
     settings = IsolatedStorageSettings.ApplicationSettings;
     if (!settings.Contains(RouteMode))
     {
         settings.Add(RouteMode, RouteModeDefault);
         settings.Save();
     }
 }
开发者ID:TabitaPL,项目名称:MobicaNavigationApplication,代码行数:10,代码来源:StorageSetting.cs

示例3: MainPage

        // コンストラクター
        public MainPage()
        {
            InitializeComponent();

            // ListBox コントロールのデータ コンテキストをサンプル データに設定します
            DataContext = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            store = IsolatedStorageSettings.ApplicationSettings;
#if DEBUG
            store.Clear();
            store.Save();
#endif
        }
开发者ID:numa08,项目名称:FollowMeAppForWinPhone,代码行数:14,代码来源:MainPage.xaml.cs

示例4: SaveCity

        private void SaveCity(string city)
        {
            m_appSettings = IsolatedStorageSettings.ApplicationSettings;
            if (m_appSettings.Contains("city"))
            {
                m_appSettings["city"] = city;
            }
            else
            {
                m_appSettings.Add("city", city);
            }
            m_appSettings.Save();

            WebService.City = city;
        }
开发者ID:zongjingyao,项目名称:WP8-OnlineBus,代码行数:15,代码来源:CitysPage.xaml.cs

示例5: AppSettings

        public AppSettings(IsolatedStorageSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            _settings = settings;
            _globalPass = new GlobalPassHandler(this);

            if (!_settings.Contains(KEY_INSTANCE_ID))
            {
                _instanceId = Guid.NewGuid().ToString("N");
                _settings[KEY_INSTANCE_ID] = _instanceId;
                _settings.Save();
            }
            else
                _instanceId = (string)_settings[KEY_INSTANCE_ID];
        }
开发者ID:AFPass,项目名称:8Pass,代码行数:17,代码来源:AppSettings.cs

示例6: loadSettings

        private void loadSettings()
        {

            settings = IsolatedStorageSettings.ApplicationSettings;
            if (!settings.Contains("cm"))
            {

                cm = true;
                settings.Add("cm", "1");
                settings.Save();

            }
            else
            {


                string cmSetting = IsolatedStorageSettings.ApplicationSettings["cm"] as string;
              
                if (cmSetting.Contains("1"))
                {
                    cm = true;
                }
                else
                {
                    cm = false;

                }

            }

            if (settings.Contains("login"))
            {
                btnLogout.IsEnabled = true;
            }

        }
开发者ID:nicholasvdb,项目名称:Bivolino_WP8,代码行数:36,代码来源:MainPage.xaml.cs

示例7: SaveOrUpdateSetting

        /// <summary>
        /// Private helper method for performing saves on settings
        /// </summary>
        /// <param name="store">The IsolatedStorageSettings store to use (either "site" or "application")</param>
        /// <param name="key">The key of the object to save</param>
        /// <param name="value">The value to be saved in storage</param>
        private static void SaveOrUpdateSetting(IsolatedStorageSettings store, string key, object value)
        {
            if (store.Contains(key))
            {
                store[key] = value;
            }

                //Otheriwse, add this new key and its value to the store
            else
            {
                store.Add(key, value);
            }
            store.Save();
        }
开发者ID:Aaronontheweb,项目名称:isolatedstorage-extensions,代码行数:20,代码来源:IsolatedStorageHelper.Settings.cs

示例8: Format

		public void Format (IsolatedStorageSettings settings, IsolatedStorageFile isf)
		{
			settings.Clear ();
			settings.Add ("a", 1);
			settings.Save ();

			Dictionary<string, object> dict = null;
			using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream ("__LocalSettings", FileMode.Open, isf)) {
				using (StreamReader sr = new StreamReader (fs)) {
					DataContractSerializer reader = new DataContractSerializer (typeof (Dictionary<string, object>));
					dict = (Dictionary<string, object>) reader.ReadObject (fs);
				}
			}

			Assert.AreEqual (1, dict.Count, "settings.Count");
			Assert.AreEqual (1, dict ["a"], "settings.a");
			dict ["b"] = 2;

			using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream ("__LocalSettings", FileMode.Create, isf)) {
				using (StreamReader sr = new StreamReader (fs)) {
					DataContractSerializer writer = new DataContractSerializer (dict.GetType ());
					writer.WriteObject (fs, dict);
				}
			}

			// saved but not re-loaded
			Assert.AreEqual (1, settings.Count, "Count");
			settings.Clear ();
		}
开发者ID:dfr0,项目名称:moon,代码行数:29,代码来源:IsolatedStorageSettingsTest.cs


注:本文中的System.IO.IsolatedStorage.IsolatedStorageSettings.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。