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


C# AppSettings.StoreSetting方法代码示例

本文整理汇总了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; }
            }
        }
开发者ID:karthikb351,项目名称:vitinfo2,代码行数:30,代码来源:MainPage.xaml.cs

示例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);
            }
        }
开发者ID:karthikb351,项目名称:vitinfo2,代码行数:27,代码来源:MainPage.xaml.cs

示例3: textBox1_TextChanged

 private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
 {
     AppSettings dat = new AppSettings();
     dat.StoreSetting("CAPTCHA", textBox1.Text.ToUpper());
 }
开发者ID:karthikb351,项目名称:vitinfo2,代码行数:5,代码来源:Captcha.xaml.cs

示例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;
 }
开发者ID:karthikb351,项目名称:vitinfo2,代码行数:7,代码来源:MainPage.xaml.cs

示例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();
                });
            }
        }
开发者ID:karthikb351,项目名称:vitinfo2,代码行数:48,代码来源:MainViewModel.cs


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