/// <summary> /// Electronic distribution via API /// </summary> /// <param name="numberOfElectrons">The number of electrons (or the number of protons)</param> /// <returns>Returns the electronic distribution</returns> public static List <string> APIElectronicDistribution(uint numberOfElectrons) { var ret = new List <string>(); var electronicConfiguration = ElementDAO.Select((int)numberOfElectrons).ElectronicConfiguration; while (Regex.Match(electronicConfiguration, @"\[.*\]").Success) { var e = ElementDAO.Select(Regex.Replace(electronicConfiguration, @"^.*\[(.*)\].*$", @"$1")); electronicConfiguration = Regex.Replace(electronicConfiguration, @"(\[(.*)\])", e.ElectronicConfiguration); } foreach (var s in electronicConfiguration.Split(' ')) { ret.Add(s); } return(ret); }
private void LoadElement(string symbol) { var element = ElementDAO.Select(symbol); LoadElementInfo(element); }
private void LoadElement(int atomicNumber) { var element = ElementDAO.Select(atomicNumber); LoadElementInfo(element); }