Example #1
0
 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);
 }
Example #2
0
        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(",", "")
            });
        }
Example #3
0
        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();
        }