New to Telerik UI for WinForms? Start a free 30-day trial

A RangeMapper that clamps indices to the valid item range instead of wrapping, disabling looping.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class RestrictedRangeMapper : RangeMapper

Inheritance: objectRangeMapperRestrictedRangeMapper

Inherited Members RangeMapper.CreateLeft(Range, Range)RangeMapper.CreateRight(Range, Range)RangeMapper.ItemsCount

Constructors

C#
public RestrictedRangeMapper()

Methods

Returns the requested item index unchanged because this mapper does not wrap.

C#
public override int Closest(int curVal, int newValue)
Parameters:curValint

The current index; it does not affect the result.

newValueint

The requested index.

Returns:

int

newValue.

Overrides: RangeMapper.Closest(int, int)

Determines whether an index lies within the supplied half-open range.

C#
public override bool IsInRange(Range range, int index)
Parameters:rangeRange

The range to test.

indexint

The index to test.

Returns:

bool

true when the index is at least From and less than To.

Overrides: RangeMapper.IsInRange(Range, int)

Clamps an index to the valid item interval instead of wrapping it.

C#
public override int MapFromRangeIndex(int index)
Parameters:indexint

The index to clamp.

Returns:

int

An index in the configured item interval; returns zero when the item count is zero.

Overrides: RangeMapper.MapFromRangeIndex(int)

Clamps an index to the supplied half-open range. For an empty range, values below From return From, while values at or above To return the nonnegative predecessor of the upper bound.

C#
public override int Normalize(Range source, int index)
Parameters:sourceRange

The range that constrains the result.

indexint

The index to clamp.

Returns:

int

The index within the range, or the boundary value selected by the clamping logic.

Overrides: RangeMapper.Normalize(Range, int)

Intersects a range with the valid item interval from zero to ItemsCount.

C#
public override Range Normalize(Range source)
Parameters:sourceRange

The range to restrict.

Returns:

Range

The intersection with the valid item interval.

Overrides: RangeMapper.Normalize(Range)