示例#1
0
 public static void Serialize(HighScores aHighScores, string aPath)
 {
     try
     {
         using (Stream lStream = new FileStream(aPath, FileMode.Create))
         {
             IFormatter lFormatter = new BinaryFormatter();
             lFormatter.Serialize(lStream, aHighScores);
         }
     }
     catch (Exception lEx)
     {
     }
 }
示例#2
0
 public void SaveHighScores()
 {
     HighScores.Serialize(mHighScores, mHighScoresPath);
 }
示例#3
0
 public MainWindowViewModel()
 {
     mHighScores = HighScores.Deserialize(mHighScoresPath);
 }