當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。