CronCalendar Class

Quartz.NET 3.0 API Documentation
This implementation of the Calendar excludes the set of times expressed by a given CronExpression.
Inheritance Hierarchy

SystemObject
  Quartz.Impl.CalendarBaseCalendar
    Quartz.Impl.CalendarCronCalendar

Namespace:  Quartz.Impl.Calendar
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
[SerializableAttribute]
public class CronCalendar : BaseCalendar

The CronCalendar type exposes the following members.

Constructors

  NameDescription
Public methodCronCalendar(String)
Initializes a new instance of the CronCalendar class.
Protected methodCronCalendar(SerializationInfo, StreamingContext)
Serialization constructor.
Public methodCronCalendar(ICalendar, String)
Create a CronCalendar with the given cron expression and BaseCalendar.
Public methodCronCalendar(ICalendar, String, TimeZoneInfo)
Create a CronCalendar with the given cron expression and BaseCalendar.
Top
Properties

  NameDescription
Public propertyCalendarBase
Set a new base calendar or remove the existing one
(Inherited from BaseCalendar.)
Public propertyCronExpression
Returns the object representation of the cron expression that defines the dates and times this calendar excludes.
Public propertyDescription
Gets or sets the description given to the ICalendar instance by its creator (if any).
(Inherited from BaseCalendar.)
Public propertyTimeZone (Overrides BaseCalendarTimeZone.)
Top
Methods

  NameDescription
Public methodClone
Creates a new object that is a copy of the current instance.
(Overrides BaseCalendarClone.)
Protected methodCloneFields (Inherited from BaseCalendar.)
Public methodEquals(Object) (Overrides BaseCalendarEquals(Object).)
Public methodEquals(BaseCalendar) (Inherited from BaseCalendar.)
Public methodEquals(CronCalendar)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode (Overrides BaseCalendarGetHashCode.)
Public methodGetNextIncludedTimeUtc
Determine the next time that is 'included' by the Calendar after the given time. Return the original value if timeStamp is included. Return 0 if all days are excluded.
(Overrides BaseCalendarGetNextIncludedTimeUtc(DateTimeOffset).)
Public methodGetObjectData (Overrides BaseCalendarGetObjectData(SerializationInfo, StreamingContext).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsTimeIncluded
Determine whether the given time is 'included' by the Calendar.
(Overrides BaseCalendarIsTimeIncluded(DateTimeOffset).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetCronExpressionString
Sets the cron expression for the calendar to a new value.
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Remarks

For example, you could use this calendar to exclude all but business hours (8AM - 5PM) every day using the expression "* * 0-7,18-23 ? * *".

It is important to remember that the cron expression here describes a set of times to be excluded from firing. Whereas the cron expression in CronTrigger describes a set of times that can be included for firing. Thus, if a ICronTrigger has a given cron expression and is associated with a CronCalendar with the same expression, the calendar will exclude all the times the trigger includes, and they will cancel each other out.

See Also

Reference