コード例 #1
0
        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();
        }
コード例 #2
0
 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);
     }
 }