private void addButton_Click(object sender, EventArgs e) { if (websiteField.Text == string.Empty) { MessageBox.Show("You must enter a website!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (directoryPath == string.Empty) { MessageBox.Show("You must select a directory!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } ServerDownloader downloader = new ServerDownloader(form); downloader.downloadServer(websiteField.Text, directoryPath); addServerForm.Close(); this.Close(); }
private void addButton_Click(object sender, EventArgs e) { if (nameField.Text == string.Empty) { MessageBox.Show("You must enter the server's name!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (websiteField.Text == string.Empty) { MessageBox.Show("You must enter a website!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (realmlistField.Text == string.Empty) { MessageBox.Show("You must enter a realmlist!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (directoryPath == string.Empty) { MessageBox.Show("You must select a directory!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Server server = new Server(); server.name = nameField.Text; server.website = websiteField.Text; server.version = VersionHelper.toVersion(((KeyValuePair <string, string>)versionCombo.SelectedItem).Value).ToString(); server.patchesDirectory = string.Empty; server.downloadDirectory = string.Empty; server.realmlist = realmlistField.Text; server.clientDirectory = directoryPath; server.locale = ClientHelper.localeVersion(server); form.addServer(server); addServerForm.Close(); }