Esempio n. 1
0
 private void tsmiOpenGame_Click(object sender, EventArgs e)
 {
     if (openGameDialog.ShowDialog(this) == DialogResult.OK)
     {
         saveGameDialog.FileName = openGameDialog.FileName;
         _game = SaverLoader.LoadFromFile(openGameDialog.FileName);
         _board.SetGame(_game);
         _io.SetGame(_game);
         _net.SetGame(_game);
         Invalidate();
         UpdateStatus();
         lvLog.VirtualListSize = _game.Log.Count;
         lvLog.Invalidate();
     }
 }
Esempio n. 2
0
 private void SaveGame()
 {
     if (string.IsNullOrWhiteSpace(saveGameDialog.FileName))
     {
         if (saveGameDialog.ShowDialog(this) == DialogResult.OK)
         {
             SaverLoader.SaveToFile(saveGameDialog.FileName, _game);
         }
     }
     else
     {
         SaverLoader.SaveToFile(saveGameDialog.FileName, _game);
     }
     tsmiSaveGame.Enabled = tsbSaveGame.Enabled = false;
 }