C# Класс Hourglass.Extensions.TimeSpanExtensions

Provides extensions methods for the TimeSpan struct.
Показать файл Открыть проект

Открытые методы

Метод Описание
RoundDown ( this timeSpan ) : System.TimeSpan

Rounds a TimeSpan down to the nearest second.

RoundDown ( this timeSpan ) : TimeSpan?

Rounds a Nullable{TimeSpan} down to the nearest second.

RoundUp ( this timeSpan ) : System.TimeSpan

Rounds a TimeSpan up to the nearest second.

RoundUp ( this timeSpan ) : TimeSpan?

Rounds a Nullable{TimeSpan} up to the nearest second.

ToNaturalString ( this timeSpan ) : string

Converts the value of a TimeSpan object to its equivalent natural string representation.

ToNaturalString ( this timeSpan, IFormatProvider provider ) : string

Converts the value of a TimeSpan object to its equivalent natural string representation.

Приватные методы

Метод Описание
GetStringWithUnits ( int value, string unit, IFormatProvider provider ) : string

Returns a string for the specified value with the specified unit (e.g., "5 minutes").

Описание методов

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

Rounds a TimeSpan down to the nearest second.
public static RoundDown ( this timeSpan ) : System.TimeSpan
timeSpan this A .
Результат System.TimeSpan

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

Rounds a Nullable{TimeSpan} down to the nearest second.
public static RoundDown ( this timeSpan ) : TimeSpan?
timeSpan this A .
Результат TimeSpan?

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

Rounds a TimeSpan up to the nearest second.
public static RoundUp ( this timeSpan ) : System.TimeSpan
timeSpan this A .
Результат System.TimeSpan

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

Rounds a Nullable{TimeSpan} up to the nearest second.
public static RoundUp ( this timeSpan ) : TimeSpan?
timeSpan this A .
Результат TimeSpan?

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

Converts the value of a TimeSpan object to its equivalent natural string representation.
public static ToNaturalString ( this timeSpan ) : string
timeSpan this A .
Результат string

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

Converts the value of a TimeSpan object to its equivalent natural string representation.
public static ToNaturalString ( this timeSpan, IFormatProvider provider ) : string
timeSpan this A .
provider IFormatProvider An .
Результат string