/// <summary> /// Se encontro un server /// </summary> internal void addServerToList(TgcSocketClient.TgcAvaliableServer server) { dataGridViewAvaliableServers.Rows.Add(dataGridViewAvaliableServers.Rows.Count, server.HostName, server.Ip); //seleccionar el primer elemento de la tabla dataGridViewAvaliableServers.Enabled = true; dataGridViewAvaliableServers.Rows[0].Selected = true; dataGridViewAvaliableServers_RowEnter(null, null); }
/// <summary> /// Agregar un server a mano /// </summary> private void buttonAddServer_Click(object sender, EventArgs e) { var textIp = textBoxAddServer.Text; IPAddress ip; var result = IPAddress.TryParse(textIp, out ip); if (result) { var server = new TgcSocketClient.TgcAvaliableServer("Manual", ip.ToString()); networkingControl.AvaliableServers.Add(server); dataGridViewAvaliableServers.Rows.Add(dataGridViewAvaliableServers.Rows.Count, server.HostName, server.Ip); dataGridViewAvaliableServers.Enabled = true; dataGridViewAvaliableServers.Rows[0].Selected = true; dataGridViewAvaliableServers_RowEnter(null, null); } else { MessageBox.Show(this, "La IP ingresada es incorrecta", "Add Server", MessageBoxButtons.OK, MessageBoxIcon.Error); textBoxAddServer.Text = ""; } }
/// <summary> /// Agregar server encontrado a la lista de servers disponibles /// </summary> public void addServerToList(TgcSocketClient.TgcAvaliableServer server) { serversDialog.addServerToList(server); }