Class
Slot

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

Slot()

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

Declaration

cs-api-definition
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.

Slot(DateTime, DateTime)

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.

Declaration

cs-api-definition
public Slot(DateTime start, DateTime end)

Parameters

start

DateTime

The start date and time for the slot.

end

DateTime

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.

Slot(IDateRange)

Initializes a new instance of the Slot class.

Declaration

cs-api-definition
public Slot(IDateRange other)

Parameters

other

IDateRange

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

Slot(Slot)

Initializes a new instance of the Slot class.

Declaration

cs-api-definition
public Slot(Slot other)

Parameters

other

Slot

Another slot that is used for initializing the new instance.

Properties

IsReadOnly

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.

Declaration

cs-api-definition
public bool IsReadOnly { get; set; }

Property Value

bool

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.

RecurrencePattern

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.

Declaration

cs-api-definition
public RecurrencePattern RecurrencePattern { get; set; }

Property Value

RecurrencePattern

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.

TimeZone

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.

Declaration

cs-api-definition
public TimeZoneInfo TimeZone { get; set; }

Property Value

TimeZoneInfo

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

Copy()

Copies this instance.

Declaration

cs-api-definition
public virtual Slot Copy()

Returns

Slot

Implements ICopyable<Slot>.Copy()

CopyFrom(Slot)

Deep copies all properties from other to this Slot.

Declaration

cs-api-definition
public virtual void CopyFrom(Slot other)

Parameters

other

Slot

The Slot which properties are copied.

Implements ICopyable<Slot>.CopyFrom(Slot)

Equals(object)

Determines whether the specified object is equal to this instance.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

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)