BalloonsPop.Highscore.HighscoreHandlingStrategies.JsonHandlingStrategy.Save C# (CSharp) Метод

Save() публичный Метод

Saves a IHighscoreTable to a JSON formatted file.
public Save ( IHighscoreTable table ) : void
table IHighscoreTable The concrete implementation of a table.
Результат void
        public void Save(IHighscoreTable table)
        {
            string json = JsonConvert.SerializeObject(table.Table.ToArray(), Formatting.Indented);
            try
            {
                File.WriteAllText(this.FileName, json);
            }
            catch (Exception ex)
            {
                Logger.Error("Cannot save highscore in json file.", ex);
                throw;
            }
        }