Beispiel #1
0
 /// <summary>
 /// Writes the specified chemical element, followed by the current line terminator, to the standard output stream.
 /// </summary>
 /// <param name="console">The console instance.</param>
 /// <param name="element">A chemicial element.</param>
 /// <param name="kind">The kind to represent the information of chemical element.</param>
 public static void WriteLine(this StyleConsole console, ChemicalElement element, ChemicalElementRepresentationKinds kind)
 => WriteLine(console, new ChemicalElementConsoleStyle(), element, kind);
Beispiel #2
0
    /// <summary>
    /// Writes the specified chemical element, followed by the current line terminator, to the standard output stream.
    /// </summary>
    /// <param name="console">The console instance.</param>
    /// <param name="style">The style.</param>
    /// <param name="element">A chemicial element.</param>
    /// <param name="kind">The kind to represent the information of chemical element.</param>
    public static void WriteLine(this StyleConsole console, ChemicalElementConsoleStyle style, ChemicalElement element, ChemicalElementRepresentationKinds kind)
    {
        var col = kind switch
        {
            ChemicalElementRepresentationKinds.Details => ToConsoleText(style, element, false),
            ChemicalElementRepresentationKinds.DetailsAndIsotopes => ToConsoleText(style, element, true),
            _ => ToSimpleConsoleText(style, element, false),
        };

        (console ?? StyleConsole.Default).Write(col);
    }
Beispiel #3
0
 /// <summary>
 /// Writes the specified chemical element, followed by the current line terminator, to the standard output stream.
 /// </summary>
 /// <param name="element">A chemicial element.</param>
 /// <param name="kind">The kind to represent the information of chemical element.</param>
 public static void WriteLine(ChemicalElement element, ChemicalElementRepresentationKinds kind)
 => WriteLine(StyleConsole.Default, new ChemicalElementConsoleStyle(), element, kind);