예제 #1
0
        private async void saveGameBtn_Click(object sender, EventArgs e)
        {
            if (saveDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    await model.SaveGameAsync(saveDialog.FileName);

                    MessageBox.Show("Game saved!");
                }
                catch (Exception excp)
                {
                    MessageBox.Show(excp.Message);
                }
            }
        }
예제 #2
0
        public async void SaveGame()
        {
            SaveFileDialog saveDialog = new SaveFileDialog();

            if (saveDialog.ShowDialog() == true)
            {
                try
                {
                    await model.SaveGameAsync(saveDialog.FileName);

                    System.Windows.MessageBox.Show("Game saved!");
                }
                catch (Exception excp)
                {
                    System.Windows.MessageBox.Show(excp.Message);
                }
            }
        }