private void OnDialogApply(object sender, EventArgs e) { string newLayerId = m_textBoxId.Text; if (IsDuplicateLayerId(newLayerId)) { m_duplicateIdMessageBox.Show(); return; } Size newLayerSize = new Size((int)m_numericLayerWidth.Value, (int)m_numericLayerHeight.Value); Size newTileSize = new Size((int)m_numericTileWidth.Value, (int)m_numericTileHeight.Value); Command command = null; if (m_isNewLayer) { m_layer.Id = newLayerId; m_layer.Description = m_textBoxDescription.Text; m_layer.LayerSize = newLayerSize; m_layer.TileSize = newTileSize; command = new LayerNewCommand(m_layer.Map, m_layer); m_isNewLayer = false; } else { command = new LayerPropertiesCommand(m_layer, newLayerId, m_textBoxDescription.Text, newLayerSize, newTileSize, m_checkBoxVisible.Checked, m_customPropertyGrid.NewProperties, m_alignmentButton.Alignment); } CommandHistory.Instance.Do(command); MarkAsApplied(); }
private void OnDialogApply(object sender, EventArgs e) { string newLayerId = m_textBoxId.Text; if (IsDuplicateLayerId(newLayerId)) { m_duplicateIdMessageBox.Show(); return; } Size newLayerSize = new Size((int)m_numericLayerWidth.Value, (int)m_numericLayerHeight.Value); Size newTileSize = new Size((int)m_numericTileWidth.Value, (int)m_numericTileHeight.Value); Command command = null; if (m_isNewLayer) { m_layer.Id = newLayerId; m_layer.Description = m_textBoxDescription.Text; m_layer.LayerSize = newLayerSize; m_layer.TileSize = newTileSize; command = new LayerNewCommand(m_layer.Map, m_layer); m_isNewLayer = false; } else command = new LayerPropertiesCommand(m_layer, newLayerId, m_textBoxDescription.Text, newLayerSize, newTileSize, m_checkBoxVisible.Checked, m_customPropertyGrid.NewProperties, m_alignmentButton.Alignment); CommandHistory.Instance.Do(command); MarkAsApplied(); }