Esempio n. 1
0
        /// <summary>
        /// Create new map.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void NewMapButton_Click(object sender, EventArgs e)
        {
            if (!MapSaveCheck())//if Save error
            {
                return;
            }
            //From for creating new map
            NewMapSettingsForm settingsForm = new NewMapSettingsForm();

            if (settingsForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            Point mapProp = settingsForm.GetMapParams();//Получаем размеры и имя карты

            if (mapProp.X == -1)
            {
                MessageBox.Show("Incorrect map parametrs");
                return;
            }
            _map = new Map(mapProp.X, mapProp.Y);
            OnMapCreating();
            DrawMap();
            MapPictBox.Tag = 1;
        }
    /// <summary>
    /// Create new map.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private void NewMapButton_Click(object sender, EventArgs e)
    {
      if (!MapSaveCheck())//if Save error
        return;
      //From for creating new map
      NewMapSettingsForm settingsForm = new NewMapSettingsForm();
      if (settingsForm.ShowDialog() != DialogResult.OK) return;

      Point mapProp = settingsForm.GetMapParams();//Получаем размеры и имя карты
      if (mapProp.X == -1)
      {
        MessageBox.Show("Incorrect map parametrs");
        return;
      }
      _map = new Map(mapProp.X, mapProp.Y);
      OnMapCreating();
      DrawMap();
      MapPictBox.Tag = 1;
    }