}//end pctLinLogo_Click private void LauncherForm_KeyDown(object sender, KeyEventArgs e) { if (!e.Control || !e.Shift || e.KeyCode != Keys.A) { return; } var addServerForm = new AddServerForm(); if (addServerForm.ShowDialog() == DialogResult.OK) { if (this._config.Servers.ContainsKey(addServerForm.txtName.Text)) { MessageBox.Show("A server with that name has already been added."); return; } this._config.Servers.Add(addServerForm.txtName.Text, new Server { IpOrDns = addServerForm.txtIpAddress.Text, Port = Convert.ToInt32(addServerForm.txtPort.Text) }); this.cmbServer.Items.Add(addServerForm.txtName.Text); this.cmbServer.SelectedIndex = cmbServer.Items.Count - 1; } //end if } //end LauncherForm_KeyDown
public Form1() { InitializeComponent(); ApplicationStatus.activeServer = null; serverContainer = new ServerContainer(this); addServerForm = new AddServerForm(this); editServerForm = new EditServerForm(this); timer = new Timer(); timer.Interval = pingInterval * 1000; timer.Tick += new EventHandler(timerTick); timer.Start(); downloadMessageWatch = new Stopwatch(); downloadMessageWatch.Start(); serverList.View = View.Details; serverList.MultiSelect = false; int columnWidth = 130; serverList.Columns.Add("Name", columnWidth, HorizontalAlignment.Left); serverList.Columns.Add("Website", columnWidth, HorizontalAlignment.Left); serverList.Columns.Add("Version", columnWidth, HorizontalAlignment.Left); serverList.Columns.Add("Status", columnWidth, HorizontalAlignment.Left); VersionChecker.checkForNewVersion(); }
public AddSimpleServerForm(Form1 form, AddServerForm addServerForm) { InitializeComponent(); this.form = form; this.addServerForm = addServerForm; directoryPath = string.Empty; }
private void addServerButton_Click(object sender, EventArgs e) { if (addServerForm == null) { addServerForm = new AddServerForm(this); } if (!addServerForm.Visible) { addServerForm.Show(); } }
public AddCustomServerForm(Form1 form, AddServerForm addServerForm) { InitializeComponent(); this.addServerForm = addServerForm; this.form = form; directoryPath = string.Empty; versionComboItems.Add("1", "Vanilla"); versionComboItems.Add("2", "The Burning Crusade"); versionComboItems.Add("3", "Wrath of the Lich King"); versionCombo.DataSource = new BindingSource(versionComboItems, null); versionCombo.DisplayMember = "Value"; versionCombo.ValueMember = "Key"; }
private void addServerButton_Click(object sender, EventArgs e) { if (addServerForm == null) addServerForm = new AddServerForm(this); if (!addServerForm.Visible) addServerForm.Show(); }