API Reference
Class
DurationPresenter
A duration in the most readable unit: 380 ms, 4.2 s, 1 m 05 s, 2 h 14 m, 3 d 4 h. Accepts TimeSpan values, or numbers in DurationPresenter.NumberUnit (seconds by default). TimeSpan.MinValue, TimeSpan.MaxValue and numbers outside the TimeSpan range show as a dash.
Inheritance
- Object
- DurationPresenter
Constructors
public DurationPresenter(TimeSpan? numberUnit = null) #Creates a duration presenter.
Parameters
- numberUnit System.TimeSpan? = null
- The unit of plain numbers (default seconds).
Methods
public static String Format(TimeSpan span, CultureInfo culture) #Returns:
StringFormats a duration with the culture's decimal separator.
Parameters
- span System.TimeSpan
- The duration.
- culture System.Globalization.CultureInfo
- The culture.
Returns
The text.
public PresentedValue Present(Object? value, PresenterContext context) #Returns:
PresentedValuePresents a value.
Parameters
- value System.Object?
- The raw value (may be null).
- context ConsoleMonster.Presenters.PresenterContext
- Culture, clock, time zone, column statistics and the render context.
Returns
The presented value.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?