New to Telerik UI for .NET MAUIStart a free 30-day trial

Slot

Class

Represents a specific time range in the scheduler that can be used for appointments, special slots, or time-based operations. Slots define contiguous time periods and can support recurrence patterns for repeating time blocks.

Definition

Constructors

Initializes a new instance of the Slot class with default values. The default constructor creates an empty slot with the current local time zone.

C#
public Slot()
Remarks:

After using this constructor, you should set the Start and End properties to define the actual time range for the slot. The TimeZone is automatically set to the system's local time zone for consistency with user expectations.

Initializes a new instance of the Slot class with the specified start and end times. This constructor provides a convenient way to create a slot with explicit time boundaries.

C#
public Slot(DateTime start, DateTime end)
Parameters:startDateTime

The start date and time for the slot.

endDateTime

The end date and time for the slot. Must be greater than or equal to start.

Remarks:

This constructor is ideal for creating slots with known time ranges. The TimeZone is automatically set to the system's local time zone. If you need a different time zone, set the TimeZone property after construction.

Initializes a new instance of the Slot class.

C#
public Slot(IDateRange other)
Parameters:otherIDateRange

A DateSpan instance that is used for initializing the new instance.

Initializes a new instance of the Slot class.

C#
public Slot(Slot other)
Parameters:otherSlot

Another slot that is used for initializing the new instance.

Properties

Gets or sets a value indicating whether this slot is read-only and cannot be modified by user interactions. Read-only slots are typically used for system-defined time periods or protected time ranges.

C#
public bool IsReadOnly { get; set; }
Property Value:

True if the slot is read-only and should not allow modifications; otherwise, false.

Remarks:

Read-only slots serve various purposes in scheduling applications:

  • System-defined breaks or maintenance windows
  • Protected time periods that users cannot override
  • Holiday or special occasion time blocks
  • Time slots reserved by administrators
  • Unavailable time periods for resource scheduling

When a slot is marked as read-only:

  • Users cannot create appointments in this time range
  • The slot may be displayed with different visual styling

Read-only status is typically enforced by the UI and business logic layers, rather than being a technical constraint of the slot itself.

Gets or sets the recurrence pattern that defines how this slot repeats over time. When set, this slot becomes a template for generating recurring slot instances.

C#
public RecurrencePattern RecurrencePattern { get; set; }
Property Value:

A RecurrencePattern object defining the repetition rules, or null for non-recurring slots.

Remarks:

Recurrence patterns enable slots to repeat according to various schedules:

  • Daily patterns: Every day, weekdays only, every N days
  • Weekly patterns: Specific days of the week, every N weeks
  • Monthly patterns: Same date each month, specific weekday patterns
  • Custom patterns: Complex repetition rules

Common use cases for recurring slots:

  • Regular break times or lunch hours
  • Recurring meeting slots or reserved times
  • Maintenance windows or system unavailability
  • Office hours or availability periods

When a recurrence pattern is applied, the scheduler can generate multiple slot instances based on the pattern rules and display them across the appropriate time periods.

Gets or sets the time zone information for this slot. This property ensures proper time zone handling for slots that may be used across different time zones.

C#
public TimeZoneInfo TimeZone { get; set; }
Property Value:

A TimeZoneInfo object representing the slot's time zone. Defaults to the system's local time zone.

Remarks:

Time zone support is important for:

  • Applications used across multiple time zones
  • Accurate slot display regardless of user location

The Start and End times should be interpreted in the context of this TimeZone. When displaying slots to users, the times may be converted to the user's local time zone for clarity.

For recurring slots, the time zone affects how recurrence instances are calculated, especially during daylight saving time transitions.

Methods

Copies this instance.

C#
public virtual Slot Copy()
Returns:

Slot

Implements: ICopyable<Slot>.Copy()

Deep copies all properties from other to this Slot.

C#
public virtual void CopyFrom(Slot other)
Parameters:otherSlot

The Slot which properties are copied.

Implements: ICopyable<Slot>.CopyFrom(Slot)

Determines whether the specified object is equal to this instance.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this instance.

Returns:

bool

true if the specified object is equal to this instance; otherwise, false.

Exceptions:

NullReferenceException

The obj parameter is null.

Overrides: DateRange.Equals(object)