示例#1
0
        /// <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);
        }
示例#2
0
        private void LoadElement(string symbol)
        {
            var element = ElementDAO.Select(symbol);

            LoadElementInfo(element);
        }
示例#3
0
        private void LoadElement(int atomicNumber)
        {
            var element = ElementDAO.Select(atomicNumber);

            LoadElementInfo(element);
        }