CSMSL.Chemistry.PeriodicTable.AddElement C# (CSharp) Метод

AddElement() публичный статический Метод

Adds an element to this periodic table if the element atomic symbol is not already present. Overrides an element if the symbol is already present.
public static AddElement ( Element element ) : bool
element Element The element to add to the periodic table
Результат bool
        public static bool AddElement(Element element)
        {
            if (_elements.ContainsKey(element.AtomicSymbol))
            {
                _elements[element.AtomicSymbol] = element;
                return false;
            }

            _elements.Add(element.AtomicSymbol, element);

            // Special case for Deuterium
            if (element.AtomicSymbol == "H")
            {
                _elements.Add("D", element);
            }
            return true;
        }