/// <summary> /// Gets the CSS class for the status icon from the specified PTB status. /// </summary> /// <param name="status">The PTB status.</param> /// <returns>The CSS class of the status icon. </returns> public static string ToStatusIcon(this StatusPTB status) { switch (status) { case StatusPTB.NoError: return("fa fa-check-circle-o"); case StatusPTB.Warning: return("fa fa-check-circle"); case StatusPTB.TemporaryError: return("fa fa-exclamation-circle"); case StatusPTB.CriticalTemporaryError: return("fa fa-exclamation-triangle"); case StatusPTB.FatalError: return("fa fa-times-circle"); default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Gets the status string for the specified PTB status. /// </summary> /// <param name="status">The status.</param> /// <param name="count">The count used for the distinction between plural and singular.</param> /// <returns>The status text.</returns> public static string GetStatusString(this StatusPTB status, int count = 0) { switch (status) { case StatusPTB.NoError: return("keine Fehler"); case StatusPTB.Warning: return(count == 1 ? "Warnung" : "Warnungen"); case StatusPTB.TemporaryError: return(count == 1 ? "temporärer Fehler" : "temporäre Fehler"); case StatusPTB.CriticalTemporaryError: return(count == 1 ? "kritischer temporärer Fehler" : "kritische temporäre Fehler"); case StatusPTB.FatalError: return(count == 1 ? "fataler Fehler" : "fatale Fehler"); default: throw new ArgumentOutOfRangeException(); } }