Esempio n. 1
0
 /// <summary>
 /// Метод обработчик события двойного клика на Label с уровнем
 /// </summary>
 private void Label_MouseDoubleClick(object sender, RoutedEventArgs e)
 {
     GameWindow.GameWindow gameWindow = new
                                        GameWindow.GameWindow((DeskOfCells)listBox.SelectedItem, false);
     gameWindow.Show();
     Window.GetWindow(this).Close();
 }
        /// <summary>
        /// Обработчик события нажатия на кнопку с размером поля
        /// </summary>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int fieldSize;

            if (!int.TryParse(((Button)sender).Content.ToString().Split('x')[0],
                              out fieldSize))
            {
                fieldSize = 10;
            }

            DeskOfCells cells = FieldGenerator.Generator(fieldSize);

            cells.Difficulty = difficulty;

            GameWindow.GameWindow gameWindow = new
                                               GameWindow.GameWindow(cells, true);
            gameWindow.Show();
            Window.GetWindow(this).Close();
        }