示例#1
0
 public async Task<bool> loadSettings()
 {
     var set = new Settings();
     var sets = set.LoadOptions();
     opt = await sets;
     //
     // first time through, give this person a guid
     if (opt == null || opt.teamNumber == 0 || opt.name == "")// || opt.bShowIntro==true)
     {
         opt = new Options();
         DisplayAlert("Identify Your Team", "Enter Team Number and Your Name", "OK");
         teamEntry.BackgroundColor = Color.Yellow;
         teamEntry.TextColor = Color.Black;
         return false;
     }
     else
     {
         teamEntry.Text = opt.teamNumber.ToString();
         nameEntry.Text = opt.name;
         getMatches();
     }
     return true;
 }
示例#2
0
 void yourName(Object sender, EventArgs args)
 {
     //Entry e = (Entry)sender;      // cast the sender object to Entry object
     //DisplayAlert("You clicked", e.ToString(), "OK");  //show the name of the object we clicked
     var set = new Settings();
     int tNum = 0;
     if (int.TryParse(teamEntry.Text, out tNum) == false)
     {
         DisplayAlert("Error", "Team number is not a number", "Ok");
         return;
     }
     opt.teamNumber = tNum;
     opt.name = nameEntry.Text;
     set.SaveOptions(opt);
     getMatches();
 }