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

public static GetElement ( string element ) : Element
element string
Результат Element
Пример #1
0
 /// <summary>
 /// Add the principal isotope of the element to this chemical formula
 /// given its chemical symbol
 /// </summary>
 /// <param name="symbol">The chemical symbol of the element to add</param>
 /// <param name="count">The number of the element to add</param>
 public void Add(string symbol, int count)
 {
     try
     {
         Isotope isotope = PeriodicTable.GetElement(symbol).PrincipalIsotope;
         Add(isotope, count);
     }
     catch (KeyNotFoundException e)
     {
         throw new KeyNotFoundException(string.Format("The element symbol '{0}' is not found in the periodic table", symbol), e);
     }
 }
Пример #2
0
        public int Count(string symbol, int atomicNumber)
        {
            Isotope isotope = PeriodicTable.GetElement(symbol)[atomicNumber];

            return(Count(isotope));
        }
Пример #3
0
        public int Count(string symbol)
        {
            Element element = PeriodicTable.GetElement(symbol);

            return(Count(element));
        }
Пример #4
0
 /// <summary>
 /// Remove all the isotopes of an chemical element represented by the symbol
 /// from this chemical formula
 /// </summary>
 /// <param name="symbol">The symbol of the chemical element to remove</param>
 /// <returns>True if the element was present and removed, false otherwise</returns>
 public int Remove(string symbol)
 {
     return(Remove(PeriodicTable.GetElement(symbol)));
 }
Пример #5
0
 /// <summary>
 /// Remove the principal isotope of the element represented by the symbol
 /// from this chemical formula
 /// </summary>
 /// <param name="symbol">The symbol of the chemical element to remove</param>
 /// <param name="count">The number of isotopes to remove</param>
 public void Remove(string symbol, int count)
 {
     Add(PeriodicTable.GetElement(symbol).PrincipalIsotope, -count);
 }