internal MemoryGameForm() { InitializeComponent(); m_SettingsForm = new SettingsForm(); DialogResult DR = m_SettingsForm.ShowDialog(); r_FirstPlayerName = m_SettingsForm.GetFirstPlayerName; r_SecondPlayerName = m_SettingsForm.GetSecondPlayerName; m_WithPhotos = m_SettingsForm.IsWithPhotos; if (DR == DialogResult.Cancel && (r_FirstPlayerName == null || r_SecondPlayerName == null)) { Close(); } else { r_RowsSize = m_SettingsForm.RowsSize; r_ColsSize = m_SettingsForm.ColsSize; m_IsAgainstComputer = m_SettingsForm.IsAgainstComputer; r_BulidBoardButtons = new BoardButton[r_RowsSize, r_ColsSize]; m_Game = new Game(); start(); drawBoard(); if (m_WithPhotos) { r_ImageList = new Image[r_RowsSize * r_ColsSize / 2]; m_PicBox = new PictureBox(); try { makeListOfPhotos(); } catch (Exception ex) { m_WithPhotos = false; MessageBox.Show(string.Format( @" {0} {1}", ex.Message, "The game will be with letters")); } } ShowDialog(); } }
public void StartApplication() { r_SettingsForm.Start += settingsForm_Start; r_GameLogic.NewGame += gameLogic_NewGame; r_SettingsForm.ShowDialog(); }