Table of Contents

ToTimeSpan Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Extensions/DoubleDecoratorExtensions.cs

ToTimeSpan(IDecorator<double>, TimeUnit)

Converts the enclosed double of the decorator to its equivalent TimeSpan representation.

public static TimeSpan ToTimeSpan(this IDecorator<double> decorator, TimeUnit unitOfTime)

Parameters

decorator IDecorator<double>

The IDecorator<T> to extend.

unitOfTime TimeUnit

One of the enumeration values that specifies the outcome of the conversion.

Returns

TimeSpan

A TimeSpan that corresponds to the enclosed double of the decorator and unitOfTime.

Exceptions

ArgumentNullException

decorator cannot be null.

OverflowException

The enclosed double of the decorator paired with unitOfTime is outside its valid range.

InvalidEnumArgumentException

unitOfTime was outside its valid range.