New to Telerik UI for WinFormsStart a free 30-day trial

Base class that maps item indices onto a fixed-size collection, supporting circular (looping) or restricted (clamped) index arithmetic used by the carousel's virtualization.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public abstract class RangeMapper

Inheritance: objectRangeMapper

Derived Classes: CircularRangeMapperRestrictedRangeMapper

Constructors

C#
protected RangeMapper()

Properties

Gets or sets the total number of items the mapper wraps or clamps indices against.

C#
public int ItemsCount { get; set; }

Methods

Resolves which wrapped occurrence of newValue is numerically closest to curVal.

C#
public abstract int Closest(int curVal, int newValue)
Parameters:curValintnewValueintReturns:

int

Creates the portion of the target range that lies before the source range's lower bound.

C#
public Range CreateLeft(Range target, Range source)
Parameters:targetRangesourceRangeReturns:

Range

Creates the portion of the target range that lies after the source range's upper bound.

C#
public Range CreateRight(Range target, Range source)
Parameters:targetRangesourceRangeReturns:

Range

Determines whether the specified index falls within the range, accounting for wrap-around.

C#
public abstract bool IsInRange(Range range, int index)
Parameters:rangeRangeindexintReturns:

bool

Converts an index that may fall outside 0..ItemsCount-1 into a valid item index according to the mapper's wrapping strategy.

C#
public abstract int MapFromRangeIndex(int index)
Parameters:indexintReturns:

int

Adjusts the specified index so it falls within the given range, wrapping by multiples of ItemsCount if needed.

C#
public abstract int Normalize(Range range, int index)
Parameters:rangeRangeindexintReturns:

int

Adjusts the specified range so its bounds are consistent with ItemsCount.

C#
public abstract Range Normalize(Range source)
Parameters:sourceRangeReturns:

Range