/** * <summary>Save single attempt to the leaderboard</summary> * <param name="attempt">Attempt to be saved</param> **/ public void SaveAttempt(Attempt attempt) { collection = LoadAttemptCollection(); collection.AttemptsList.Add(attempt); collection.AttemptsList.Sort(); var xmlString = serializer.SerializeAttempts(collection); dataAccess.SaveXmlCollection(xmlString); }
/** * <summary>No file was created - create an empty one </summary> **/ private void HandleException() { var serializer = new AttemptCollectionSerializer(); SaveXmlCollection(serializer.SerializeAttempts(new AttemptCollection())); }