本文整理汇总了C#中AppSettings.StoreSetting方法的典型用法代码示例。如果您正苦于以下问题:C# AppSettings.StoreSetting方法的具体用法?C# AppSettings.StoreSetting怎么用?C# AppSettings.StoreSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppSettings
的用法示例。
在下文中一共展示了AppSettings.StoreSetting方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (e.NavigationMode == NavigationMode.New)
{
IDictionary<string, string> parameters = this.NavigationContext.QueryString;
if (parameters.ContainsKey("ONLINE"))
{
offline = false;
}
dat = new AppSettings();
String regno;
bool firstRun;
firstRun = dat.TryGetSetting<string>("REGNO", out regno);
//CHECK IF FIRST RUN
if (firstRun)
{
loadData();
//CHECK IF ONLINE OR OFFLINE
if (offline) { dat.StoreSetting("OFFLINE", Convert.ToString(offline)); App.ViewModel.LoadData(); }
else { offline = false; show_captcha(); }
}
else { Controller.DefaultItem = Controller.Items[2]; offline = false; }
}
}
示例2: button1_Click
private void button1_Click(object sender, RoutedEventArgs e)
{
dat = new AppSettings();
DateTime dater;
String regno , day , month , year;
dater = datePicker.Value.Value;
if (txt_REG.Text.TrimEnd() != "")
{
regno = txt_REG.Text;
day = checkDate(dater.Day.ToString());
month = checkDate(dater.Month.ToString());
year = dater.Year.ToString();
dat.StoreSetting("REGNO", regno);
dat.StoreSetting("DAY", day);
dat.StoreSetting("MONTH", month);
dat.StoreSetting("YEAR", year);
offline = false;
show_captcha();
}
else {
MessageBox.Show("Please enter a valid registration and date of birth", "Error", MessageBoxButton.OK);
}
}
示例3: textBox1_TextChanged
private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
AppSettings dat = new AppSettings();
dat.StoreSetting("CAPTCHA", textBox1.Text.ToUpper());
}
示例4: messagePrompt_Completed
void messagePrompt_Completed(object sender, PopUpEventArgs<string, PopUpResult> e)
{
dat = new AppSettings();
dat.StoreSetting("OFFLINE", Convert.ToString(offline));
App.ViewModel.LoadData();
offline = true;
}
示例5: DownloadComplete
void DownloadComplete(object sender, DownloadStringCompletedEventArgs e)
{
try
{
List<String> data = new List<String>();
AppSettings dat = new AppSettings();
string jData = e.Result.ToString();
int count = 0;
if (jData.Contains("valid%"))
{
jData = jData.Substring(6);
JsonTextReader reader = new JsonTextReader(new System.IO.StringReader(jData));
JArray root = JArray.Load(reader);
foreach (JObject j in root)
{
data.Add("BREAK" + count); count += 1;
data.Add((string)j["code"]); //0
data.Add((string)j["title"]); //1
data.Add((string)j["type"]); //2
data.Add((string)j["slot"]); //3
data.Add((string)j["attended"]); //4
data.Add((string)j["conducted"]); //5
data.Add((string)j["percentage"]); //6
data.Add((string)j["regdate"]); //7
data.Add((string)j["classnbr"]); //8
JArray details = (JArray)j["details"];
for (int i = 0; i < details.Count; i++) { data.Add(details[i].ToString()); }
}
dat.StoreSetting("NUMBEROFSUBJECTS", Convert.ToString(count - 1));
dat.saveList("ATTENDANCE", data);
}
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
reloadData();
});
}
catch (Exception k)
{
Debug.WriteLine(k.Message);
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
reloadData();
});
}
}