public void WriteInformation() { Saver saver = new Saver(); Config cfg = saver.GetConfig(); CountOfAllGames.Text = cfg.GetNumberOfRecords().ToString(); CountOfWonGames.Text = cfg.GetNumberOfWonGames().ToString(); PercentOfWonGames.Text = cfg.PercentOfWinnings().ToString() + "%"; BestResult.Text = cfg.GetBestRecord(); }
private void SaveInformationOfTheGame() { IsSure = false; if (!GameIsWonStatus) { Warning window = new Warning(); window.owner = this; window.ShowDialog(); } if (IsSure || GameIsWonStatus) { Saver saver = new Saver(); Config cfg = saver.GetConfig(); Record currentRecord = new Record(countOfStrokes, GameIsWonStatus); cfg.AddRecord(currentRecord); saver.Save(cfg); } }