Exemple #1
0
 private static int sortByScores(Storage x, Storage y)
 {
     if (x.Score > y.Score) return -1;
     else if (x.Score == y.Score) return 0;
     else return 1;
 }
Exemple #2
0
        public void addScore(String nick, double score)
        {
            using (ScoreDB newDB = new ScoreDB("Data Source=isostore:/Sample.sdf"))
            {
                Storage newScore = new Storage();
                newScore.Nick = nick;
                newScore.Score = Convert.ToInt32(score);
                newScore.Date = DateTime.Now;

                newDB.ScoresTable.InsertOnSubmit(newScore);
                newDB.SubmitChanges();
            }
        }