Esempio n. 1
0
        Dialog scoreDialog()
        {
            Dialog dialog = new Dialog(this);

            dialog.SetContentView(Resource.Layout.namePrompt);
            dialog.SetTitle("Enter Your Name");
            dialog.SetCancelable(true);

            TextView tvScore = (TextView)dialog.FindViewById(Resource.Id.score);

            tvScore.Text = String.Format("Your Score: {0}", score);
            EditText input = (EditText)dialog.FindViewById(Resource.Id.etName);
            Button   ok    = (Button)dialog.FindViewById(Resource.Id.ok);

            ok.Click += delegate {
                if (input.Text.Length > 0)
                {
                    var dbS = new ScoreCommands(this);
                    dbS.AddScore(score, DateTime.Now, input.Text);
                    Intent i = new Intent(this, typeof(EndActivity));
                    i.PutExtra("SCORE", score);
                    StartActivity(i);
                    Finish();
                    dialog.Cancel();
                }
                else
                {
                    Toast.MakeText(this, "Enter Name", ToastLength.Short).Show();
                }
            };

            return(dialog);
        }
Esempio n. 2
0
        void MakeScoreDB()
        {
            var dbs = new ScoreCommands (this);
            string[] scr = Resources.GetStringArray (Resource.Array.scores);

            foreach (string s in scr) {
                string[] st = s.Split ('_');

                dbs.AddScore (Convert.ToInt32 (st[0]), DateTime.Now, st[1]);
            }
        }
Esempio n. 3
0
        void MakeScoreDB()
        {
            var dbs = new ScoreCommands(this);

            string[] scr = Resources.GetStringArray(Resource.Array.scores);

            foreach (string s in scr)
            {
                string[] st = s.Split('_');

                dbs.AddScore(Convert.ToInt32(st[0]), DateTime.Now, st[1]);
            }
        }