private void buttonOk_Click(object sender, EventArgs e) { Details = new CreationDetails() { MapWidth = (int)numericMapWidth.Value, MapHeight = (int)numericMapHeight.Value, TileWidth = (int)numericTileWidth.Value, TileHeight = (int)numericTileHeight.Value }; Close(); }
/// <summary> /// buttonOkay_Click(object, EventArgs) /// Handler for when the OK button is clicked in the NewMapDialog; /// Creates instance of creationDetails, getting values from the NumericUpDown boxes. /// Closes then dialog. /// </summary> /// <param name="sender">(object) - The object signaling the event.</param> /// <param name="e">(EventArgs) - The type of event being sent.</param> private void buttonOkay_Click(object sender, EventArgs e) { // Create new creationDetails object from data returned form NumericUpDown boxes creationDetails = new CreationDetails() { MapWidth = (int)numericMapWidth.Value, MapHeight = (int)numericMapHeight.Value, TileWidth = (int)numericTileWidth.Value, TileHeight = (int)numericTileHeight.Value }; Close(); // Close the dialog. }