ScheduleIsActiveTime(DateTime, Schedule, Schedule) Method

if schedule have OfficeHours type it references some other "parent" schedule which should define the exact set of time ranges This method allows to combine check of "inherited" schedules and return result from the first which defines exact time ranges

Definition

Namespace: TCX.Configuration
Assembly: 3cxpscomcpp2 (in 3cxpscomcpp2.dll) Version: 20.0.1
C#
public bool IsActiveTime(
	DateTime dt,
	out Schedule definedBy,
	params Schedule[] parentSchedules
)

Parameters

dt  DateTime
the exact date time in the time zone of schedule. No conversion is performed.
definedBy  Schedule
the refrence to the schedule (one of the parentSchedules) which gave the result. could be set to null, what means that there are no schedule which can define the result.
parentSchedules  Schedule
the schedules which should be recoursively used in case if schedule has OfficeHours type.

Return Value

Boolean
answers the question: "does the schedule is active at specified time".

Remarks

HoursTypev alue influences result:
AllHours - always Active time. could be deactivated at holidays to make it except holidays only
Never - always inactive time. such schedule can be activated at holidays to make it holidays only
OfficeHours or BreakTime - returns value using chain specified by parentSchedules
OutOfOfficeHours - returns negated value returned by parentSchedules
SpecificHours or SpecificHoursExcludingHolidays - true - if the requested time is in the one of schedule time ranges
OutOfSpecificHours or OutOfSpecificHoursIncludingHolidays - true if requested time is not in any of schedule time ranges
otherwise - false.
if all the schedules (this and parentSchedules) are of OfficeHours/Out of office hours type. return value is false and definedBy is set to null.

See Also