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

Provides the row traversal and drawing hooks used to render a scheduler time ruler.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public abstract class RulerRendererBase

Inheritance: objectRulerRendererBase

Derived Classes: RulerRenderer

Constructors

Initializes the renderer for the specified ruler.

C#
public RulerRendererBase(RulerPrimitive ruler)
Parameters:rulerRulerPrimitive

The ruler that supplies the scale and visual settings.

Fields

Reset before each render pass; derived renderers can set it when they draw ruler content.

C#
protected bool isDrawn

The ruler whose scale, layout, and appearance this renderer uses.

C#
protected RulerPrimitive ruler

Methods

Calculates and renders the current-time marker when ShowCurrentTime is enabled. The base implementation calculates its position from Now.

C#
protected void DrawCurrentTimePointer(IGraphics graphics, float y, DateTime currentTime)
Parameters:graphicsIGraphics

The graphics context used to draw the marker.

yfloat

Currently unused by the base implementation.

currentTimeDateTime

Currently unused; the calculation uses Now instead.

Draws the hour and minute labels on the same ruler row.

C#
protected Size DrawTimeText(IGraphics graphics, float y, string text, string minutesText, Size measuredSize)
Parameters:graphicsIGraphics

The graphics context used to draw the labels.

yfloat

The vertical position of the labels.

textstring

The hour label.

minutesTextstring

The minute label displayed beside the hour.

measuredSizeSize

The measured size supplied by the caller.

Returns:

Size

The supplied measuredSize; this method does not modify the measurement.

Gets the bounds calculated for a ruler row.

C#
public RectangleF GetHourBounds(int hour)
Parameters:hourint

The nonnegative, zero-based row index.

Returns:

RectangleF

The row bounds, or Empty when hour is beyond the calculated rows.

Exceptions: ArgumentOutOfRangeException

hour is negative.

Gets the number of ruler intervals in one hour for the current scale.

C#
protected int GetSpecificRange()
Returns:

int

The number of intervals per hour.

Walks the ruler intervals, dispatches hour and sub-hour drawing, and then renders the current-time marker.

C#
public virtual void Render(IGraphics graphics)
Parameters:graphicsIGraphics

The graphics context used to draw the ruler.

Renders the current-time marker at the specified vertical position. The base implementation does nothing.

C#
public virtual void RenderCurrentTimePointer(IGraphics graphics, float y)
Parameters:graphicsIGraphics

The graphics context used to draw the marker.

yfloat

The vertical position of the marker.

Draws a major hour interval within the supplied ruler row.

C#
public abstract void RenderHour(IGraphics graphics, int hour, RectangleF bounds)
Parameters:graphicsIGraphics

The graphics context used to draw the interval.

hourint

The hour index for the interval.

boundsRectangleF

The bounds of the ruler row.

Draws a sub-hour interval within the supplied ruler row.

C#
public abstract void RenderSubHour(IGraphics graphics, int hour, int sectionIndex, RectangleF bounds)
Parameters:graphicsIGraphics

The graphics context used to draw the interval.

hourint

The hour index containing the interval.

sectionIndexint

The sub-hour interval's index within the hour.

boundsRectangleF

The bounds of the ruler row.