Table of Contents

Class TimeOnlyExtensions

Namespace
Plugin.BaseTypeExtensions
Assembly
Plugin.BaseTypeExtensions.dll

Provides extension methods for TimeOnly operations, such as range checks and percentage calculations.

public static class TimeOnlyExtensions
Inheritance
TimeOnlyExtensions
Inherited Members

Methods

PercentageToTimeOnly(double, TimeOnly, TimeOnly)

Converts a percentage (0.0 to 1.0) to a TimeOnly value within the specified range.

public static TimeOnly PercentageToTimeOnly(this double percentage, TimeOnly minBound, TimeOnly maxBound)

Parameters

percentage double

The percentage value (0.0 to 1.0)

minBound TimeOnly

The minimum bound of the target range

maxBound TimeOnly

The maximum bound of the target range

Returns

TimeOnly

The calculated TimeOnly value within the specified range

Exceptions

ArgumentOutOfRangeException

Thrown when minBound is greater than maxBound

TimeOnlyToPercentage(TimeOnly, TimeOnly, TimeOnly)

Converts a TimeOnly value within a specified range to a percentage (0.0 to 1.0).

public static double TimeOnlyToPercentage(this TimeOnly value, TimeOnly minBound, TimeOnly maxBound)

Parameters

value TimeOnly

The TimeOnly value to convert

minBound TimeOnly

The minimum bound of the source range

maxBound TimeOnly

The maximum bound of the source range

Returns

double

The percentage representation (0.0 to 1.0)

Exceptions

ArgumentOutOfRangeException

Thrown when minBound is greater than maxBound