本文整理汇总了C#中System.IO.IsolatedStorage.IsolatedStorageSettings.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IsolatedStorageSettings.Add方法的具体用法?C# IsolatedStorageSettings.Add怎么用?C# IsolatedStorageSettings.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.IsolatedStorage.IsolatedStorageSettings
的用法示例。
在下文中一共展示了IsolatedStorageSettings.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDefaultSettings
private static void AddDefaultSettings(IsolatedStorageSettings settings)
{
settings.Add("MidThreshold", 8000);
settings.Add("LowThreshold", 9000);
settings.Add("MidRate", 1024);
settings.Add("LowRate", 256);
settings.Add("PctDiscount", 75);
}
示例2: Password
public Password()
{
InitializeComponent();
appSettings = IsolatedStorageSettings.ApplicationSettings;
if (!appSettings.Contains("pass")) {
appSettings.Add("pass", "blue");
}
if (!appSettings.Contains("fake")) {
appSettings.Add("fake", "red");
}
pass = (string)appSettings["pass"];
fakePass = (string)appSettings["fake"];
}
示例3: StorageHandler
public StorageHandler()
{
settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains(levelsKey))
{
settings.Add(levelsKey, new LevelsInfo());
}
if (!settings.Contains(challengesKey))
{
settings.Add(challengesKey, new ChallengesInfo());
}
}
示例4: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
settings = IsolatedStorageSettings.ApplicationSettings;
if (! settings.Contains("data")) {
settings.Add("data", "");
}
}
示例5: StorageSetting
//constructor gets settings
public StorageSetting()
{
settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains(RouteMode))
{
settings.Add(RouteMode, RouteModeDefault);
settings.Save();
}
}
示例6: MainPage
// Constructor
public MainPage()
{
settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains("index"))
{
settings.Add("index", 0);
settings.Add("primero", 0);
}
else
{
valorInicial = Convert.ToInt32(settings["index"]);
}
InitializeComponent();
this.Loaded += MainPage_Loaded;
}
示例7: FotoTomada_Loaded
void FotoTomada_Loaded(object sender, RoutedEventArgs e)
{
ReadFromIsolatedStorage("FotoSacada");
settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains("mostrarPopUp"))
{
settings.Add("mostrarPopUp","True");
}
}
示例8: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
settings = IsolatedStorageSettings.ApplicationSettings;
if (! settings.Contains("memory")) {
settings.Add("memory", "");
}
if (!settings.Contains("haptic")) {
settings.Add("haptic", is_haptic);
}
is_haptic = settings["haptic"].ToString();
b_haptic = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
b_nohaptic = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
b_point = (ApplicationBarIconButton)ApplicationBar.Buttons[2];
b_comma = (ApplicationBarIconButton)ApplicationBar.Buttons[3];
b_haptic.IsEnabled = is_haptic == "0";
b_nohaptic.IsEnabled = is_haptic != "0";
// decimal point or comma is hidden during a callback in do_load()
}
示例9: LoadSettings
private void LoadSettings()
{
_isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;
if (_isolatedStorageSettings.Contains(_merchantServerUrlKey))
{
MerchantServerUrl.Text = (string)_isolatedStorageSettings[_merchantServerUrlKey];
}
else _isolatedStorageSettings.Add(_merchantServerUrlKey, "");
}
示例10: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
//Thread.Sleep(2000);
settings = IsolatedStorageSettings.ApplicationSettings;
colocarAudiosSiNoExisten();
if (!settings.Contains("mostrarMensajeMusica"))
{
//MessageBox.Show("hola");
settings.Add("mostrarMensajeMusica", "false");
}
}
示例11: Write
public bool Write(string key, string val)
{
try
{
settings = IsolatedStorageSettings.ApplicationSettings;
settings.Add(key, val);
return true;
}
catch(ArgumentException ex)
{
return false;
}
}
示例12: 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;
}
示例13: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
settings = IsolatedStorageSettings.ApplicationSettings;
ready = false;
DateTime now = DateTime.Now;
Debugger.Log(0, "Debug", "NextCirc Version " + NextCirc.Images.About.appVersion.ToString("N1") + "\nCurrent Time: " + now.ToShortDateString() + " " + now.ToShortTimeString() + "\n\n");
// Load saved stop
if (settings.Contains(curStopKey))
{
currentStop = Convert.ToInt32(settings[curStopKey]);
Debugger.Log(0, "Debug", "found setting = " + currentStop + "\n");
}
else
{
settings.Add(curStopKey, currentStop);
Debugger.Log(0, "Debug", "no setting\n");
}
// Build list of stops
stopList = new List<CircStop>();
// TODO: stopList.Add(new CircStop("NextCirc", new GeoCoordinate(0, 0), 0));
stopList.Add(new CircStop("south forty", new GeoCoordinate(38.645327, -90.312952), 0));
stopList.Add(new CircStop("mallinckrodt (to skinker)", new GeoCoordinate(38.647021, -90.309522), 3));
stopList.Add(new CircStop("skinker", new GeoCoordinate(38.647654, -90.30133), 6));
stopList.Add(new CircStop("millbrook", new GeoCoordinate(38.650172, -90.311331), 10));
stopList.Add(new CircStop("brookings", new GeoCoordinate(38.647923, -90.304025), 14));
stopList.Add(new CircStop("mallinckrodt (to south forty)", new GeoCoordinate(38.647021, -90.309522), 17));
this.stopPicker.ItemsSource = stopList;
this.stopPicker.SelectedIndex = currentStop;
ready = true;
Debugger.Log(0, "Debug", "initialized.\n");
chooseStop(currentStop);
// Register timer to keep View up to date
DispatcherTimer timer = new DispatcherTimer();
timer.Tick += timer_Tick;
timer.Interval = new TimeSpan(0, 0, 1);
timer.Start();
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
示例14: TrySetIndividualSetting
private void TrySetIndividualSetting(IsolatedStorageSettings settings, Setting settingNameEnum, string settingValue)
{
var settingName = settingNameEnum.ToString();
if (settings.Contains(settingName))
{
settings[settingName] = settingValue;
}
else
{
settings.Add(settingName, settingValue);
}
}
示例15: 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;
}
}