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) { } }
public void SaveHighScores() { HighScores.Serialize(mHighScores, mHighScoresPath); }
public MainWindowViewModel() { mHighScores = HighScores.Deserialize(mHighScoresPath); }