public void initPeriodicTable()
        {
            List <Applicazione.DataModel.ChemicalElement> periodic = PeriodicTable.GetChemicalElements();

            foreach (Applicazione.DataModel.ChemicalElement baseElement in periodic)
            {
                ChemicalElement derivedElement = new ChemicalElement();
                derivedElement.initElementDataFromFather(baseElement);
                this.table.Add(derivedElement);
            }
        }
Exemplo n.º 2
0
 private void getSeedsFromGrid(List <Core.ChemicalElement> elements, List <double> quantities, DataGridView _grid)
 {
     foreach (DataGridViewRow row in _grid.Rows)
     {
         if (!row.IsNewRow)
         {
             foreach (DataGridViewCell cell in row.Cells)
             {
                 if (cell.ValueType == typeof(Core.ChemicalElement))
                 {
                     UI.ChemicalElement element = new UI.ChemicalElement();
                     element.initElementDataFromFather((Core.ChemicalElement)cell.Value);
                     elements.Add(element);
                 }
                 if (cell.ValueType == typeof(double) || cell.ValueType == typeof(int))
                 {
                     quantities.Add((double)cell.Value);
                 }
             }
         }
     }
 }