Esempio n. 1
0
        void DisplayHighscores()
        {
            TextView pName, pScore;

            List<Score> allScores = new List<Score> ();
            try {
                var dbS = new ScoreCommands (this);
                allScores = dbS.TopScores ();
            } catch (System.Exception sysExc) {
                Toast.MakeText (this, sysExc.Message, ToastLength.Long);
            }
            Score[] highScores = allScores.ToArray ();

            for (int i = 0; i<10; i++) {
                Score s = highScores[i];
                pName = FindViewById<TextView>(topNames[i]);
                pScore = FindViewById<TextView>(topScores[i]);

                pName.Text = s.PlayerName;
                pScore.Text = s.ScoreNumber.ToString ();
            }
        }
Esempio n. 2
0
        void DisplayHighscores()
        {
            TextView pName, pScore;

            List <Score> allScores = new List <Score> ();

            try {
                var dbS = new ScoreCommands(this);
                allScores = dbS.TopScores();
            } catch (System.Exception sysExc) {
                Toast.MakeText(this, sysExc.Message, ToastLength.Long);
            }
            Score[] highScores = allScores.ToArray();

            for (int i = 0; i < 10; i++)
            {
                Score s = highScores[i];
                pName  = FindViewById <TextView>(topNames[i]);
                pScore = FindViewById <TextView>(topScores[i]);

                pName.Text  = s.PlayerName;
                pScore.Text = s.ScoreNumber.ToString();
            }
        }