private bool ValidaAtomo(string id) { if (AtomoList.ToList().Find(a => a.Id.Equals(id)) != null) { return(true); } this.Lbl_MensajeError.Content = "Atomo no encontrado: \n" + id; return(false); }
private void GuardarAtomo(object sender, RoutedEventArgs e) { string lastRow = GetLastId(AtomoFile); File.AppendAllText(AtomoFile, lastRow + "," + this.TxtBox_Atomo.Text.Replace(",", "") + "\n"); AtomoList.Add(new Atomo() { Id = lastRow, Descripcion = this.TxtBox_Atomo.Text.Replace(",", "") }); }
public void LoadFileData() { ProposicionList.Clear(); AtomoList.Clear(); string[] atomsTmp = File.ReadAllLines(AtomoFile); foreach (string atomRow in atomsTmp) { string[] tmp = atomRow.Split(','); AtomoList.Add(new Atomo() { Id = tmp[0], Descripcion = tmp[1] }); } ParseProposiciones(); }