private List <parEstructura> leerArchivoParEstructura(string archivo) { List <parEstructura> lista = new List <parEstructura>(); using (StreamReader file = new StreamReader(archivo)) { while (!file.EndOfStream) { string[] aux = file.ReadLine().Split(','); parEstructura par = new parEstructura() { estructuraNombre = aux[0], structureID = aux[1], }; lista.Add(par); } } return(lista); }
private List <parEstructura> listaParesEstructuras() { List <parEstructura> lista = new List <parEstructura>(); foreach (DataGridViewRow fila in DGV_Estructuras.Rows) { parEstructura par = new parEstructura() { estructuraNombre = fila.Cells[0].Value.ToString(), }; if (fila.Cells[1].Value != null) { par.structureID = fila.Cells[1].Value.ToString(); } lista.Add(par); } return(lista); }