Table of Contents

Class DaySpecification

Namespace
ArcanaDevelopment.adTempus.Client
Assembly
ArcanaDevelopment.adTempus.Client.dll

Specifies the day(s) that a DateCriterion applies to, by specifying a specific date or a rule to determine the date.

[ComVisible(true)]
[Guid("30d28de4-7ce6-4a81-92c4-9860144ca3e1")]
public sealed class DaySpecification : ADTObject
Inheritance
object
DaySpecification

Remarks

The SpecificationType property determines how the specification behaves, and which properties must be set. The following table explains the valid settings.

SpecificationTypeOther Settings Required
SpecifiedDays Select the appropriate Months and Days.
SpecifiedWeekdaysSelect the appropriate Months and Weekdays.
FloatingOffsetSelect the appropriate Months and Weekdays. Select the Occurrence and optionally an Offset. To calculate the date relative to another DaySpecification (instead of relative to the beginning of the month) set the OccurrenceBase and the RelativityType.
EndOfMonthOffsetSelect the appropriate Months and specify an Offset.
EasterOffsetSpecify an Offset (do not select any Months).

Properties

ClassID

The Class ID for the object

[IgnoreDataMember]
public override ClassID ClassID { get; }

Property Value

ClassID

ClassKeyName

The key name for the class.

public override string ClassKeyName { get; }

Property Value

string

Remarks

This name the name used by adTempus to identify the class and is intended for programmatic use only. Use the ClassName for a user-friendly name.

DateCriterion

The DateCriterion this rule belongs to

public DateCriterion DateCriterion { get; set; }

Property Value

DateCriterion

DayMask

A bitmask indicating which days are selected for this rule.

public int DayMask { get; set; }

Property Value

int

Remarks

The DayMask allows you to get or set the day selection, without selecting individual days using GetDay(int) and SetDay(int, bool). The DayMask is a bit mask, with bits 1-31 representing days 1-31.

For example, to select days 1 and 3 you would set bits 1 (=0x2 or binary 10) and 2 (=0x4 or binary 100), so the DayMask would be set to 6 (binary 110).

To select all days, set the DayMask to AllDays.

To apply the rule to the last day of the selected months (regardless of the number of days in each month), select day 31 and set Treat31stAsLast to true.

See Also

Enabled

Determines whether this rule is enabled or disabled

public bool Enabled { get; set; }

Property Value

bool

Remarks

Disabled criteria are ignored

IsDependent

Indicates whether the object is a dependent of (owned by) another object

[IgnoreDataMember]
public override bool IsDependent { get; }

Property Value

bool

Remarks

An independent object (IsDependent is false) is an object that can exist on its own without being part of another object. For example, Jobs, Job Groups, etc.

A dependent object (IsDependent is true) is a part of another object. For example, a JobStep cannot exist independently of a Job, so the JobStep is dependent.

Dependent objects cannot be directly fetched from the server: they are only fetched as part of the object they belong to. They also cannot be saved or deleted independently: they are automatically saved or deleted when the owning object is saved or deleted.

MonthMask

A bitmask indicating which months are selected for this rule.

public int MonthMask { get; set; }

Property Value

int

Remarks

The MonthMask allows you to get or set the month selection, without selecting individual months using GetMonth(int) and SetMonth(int, bool). The MonthMask is a bit mask, with bits 1-12 representing months 1-12.

For example, to select February and March you would set bits 2 (0x4 or binary 100) and 3 (0x8 or binary 1000), so the MonthMask would be set to 0xC (binary 1100).

To select all months, set the MonthMask to AllMonths.

See Also

Name

An optional descriptive name for the day specification, used in the user interface.

public string Name { get; set; }

Property Value

string

Occurrence

Indicates which occurrence (1st, 2d, 3d, etc.) of the selected weekday(s) to trigger on.

public OccurrenceType Occurrence { get; set; }

Property Value

OccurrenceType

Remarks

The Occurrence is used only when the SpecificationType is FloatingOffset. See the DaySpecification overview for a discussion of these values.

OccurrenceBase

The DaySpecification defining the rule that this rule occurs relative to.

public DaySpecification OccurrenceBase { get; set; }

Property Value

DaySpecification

Offset

Gets or sets the number of days by which the target date is offset from the date specified by the rule.

public int Offset { get; set; }

Property Value

int

Remarks

If the SpecificationType is FloatingOffset, EndOfMonthOffset, or EasterOffset, the Offset specifies the offset from the calculated date.

For example, if the SpecificationType is EasterOffset, the calculated date will be Easter. To trigger on Easter, set the Offset to 0. To trigger on Good Friday (2 days before Easter), set the Offset to -2. To trigger on the Monday after Easter, set the Offset to 1.

Recurrence

The frequency at which this item recurs.

public int Recurrence { get; set; }

Property Value

int

Remarks

Valid only when SpecificationType is SpecifiedWeekdays. The rule applies every Recurrence weeks as measured from the date specified by the RecurrenceRelativeTo value.

RecurrenceRelativeTo

Indicates what date a recurring criterion is calculated relative to

public RecurrenceStart RecurrenceRelativeTo { get; set; }

Property Value

RecurrenceStart

RelativityType

Options that affect calculations when SpecificationType is DaySpecificationType.FloatingOffset

public RelativityType RelativityType { get; set; }

Property Value

RelativityType

SpecificationType

Indicates the type of rule used for this item.

public DaySpecificationType SpecificationType { get; set; }

Property Value

DaySpecificationType

Remarks

See the DaySpecification overview for a discussion of these values.

Treat31stAsLast

Determines whether the rule will always apply on the last day of the month if the DayMask contains day 31.

[RequiredVersion(5, 0, 0, 0)]
public bool Treat31stAsLast { get; set; }

Property Value

bool

Remarks

If Treat31stAsLast is true (the default) and the DayMask contains day 31, this rule will apply on the last day of the month for months that have fewer than 31 days. If Treat31stAsLast is false and the DayMask contains 31, the rule applies only in months that actually have 31 days.

If the server version is earlier than 5.0, this setting has no effect and day 31 always applies to the last day of the month.

WeekdayMask

public int WeekdayMask { get; set; }

Property Value

int

Remarks

The WeekdayMask allows you to get or set the weekday selection, without selecting individual days using GetWeekday(Weekday) and SetWeekday(Weekday, bool). The WeekdayMask is a bit mask, with bits 1-7 representing days 1-7 (Sunday is day 1; Saturday is day 7).

For example, to select Saturday and Sunday you would set bits 1 (=0x2 or binary 10) and 7 (=0x40 or binary 1000000), so the WeekdayMask would be set to 0x42 (binary 1000010). To select all days of the week, set the WeekdayMask to AllDaysOfWeek.

See Also

Year

The year to which this item applies.

public int Year { get; set; }

Property Value

int

Remarks

Set to 0 for all years.

Methods

FindOwningObject()

Get the owner of this object based on relationships.

protected override ADTObject FindOwningObject()

Returns

ADTObject

The owning object, or null if the object is not owned by another object or the owner has not been set.

GetDay(int)

Determines whether the rule applies to the specified day of the month

public bool GetDay(int dayNumber)

Parameters

NameTypeDescription
dayNumber int

The day of the month (1-31)

Returns

bool
See Also

GetMonth(int)

Determines whether this rule applies to the specified month

public bool GetMonth(int monthNumber)

Parameters

NameTypeDescription
monthNumber int

The month number (1=January, 12=December).

Returns

bool
See Also

GetObjectDescription()

Gets a description of the object's key settings.

protected override string GetObjectDescription()

Returns

string

Remarks

This method is called by GetDescription() to get a user-friendly description of the object (such as its key settings) for display to the user. The description should contain enough information to distinguish this object from others of the same class.

GetWeekday(Weekday)

Determines whether the rule applies to the specified day of the week

public bool GetWeekday(Weekday weekdayNumber)

Parameters

NameTypeDescription
weekdayNumber Weekday

The day of the week

Returns

bool

Remarks

Note that the adTempus Weekday enum used here uses different values than the Windows System.DayOfWeek.

GetWeekday(int)

Determines whether the rule applies to the specified day of the week

public bool GetWeekday(int weekdayNumber)

Parameters

NameTypeDescription
weekdayNumber int

The day of the week. This must be one of the Weekday values

Returns

bool

Remarks

Note that the adTempus Weekday enum used here uses different values than the Windows System.DayOfWeek.

SetDay(int, bool)

Determines whether the rule applies to the specified day of the month

public void SetDay(int dayNumber, bool selected)

Parameters

NameTypeDescription
dayNumber int

The day of the month (1-31)

selected bool

true to select the specified day, false to deselect it.

Remarks

To apply the rule to the last day of the selected months (regardless of the number of days in each month), select day 31 and set Treat31stAsLast to true.

See Also

SetMonth(int, bool)

Selects to deselects the specified month for this rule

public void SetMonth(int monthNumber, bool selected)

Parameters

NameTypeDescription
monthNumber int

The month number (1=January, 12=December).

selected bool

true to select the specified month, false to deselect it.

SetWeekday(Weekday, bool)

Selects or deselects the specified day of the week

public void SetWeekday(Weekday weekdayNumber, bool selected)

Parameters

NameTypeDescription
weekdayNumber Weekday

The day of the week

selected bool

true to select the specified day, false to deselect it.

Remarks

Note that the adTempus Weekday enum used here uses different values than the Windows System.DayOfWeek.

SetWeekday(int, bool)

Selects or deselects the specified day of the week

public void SetWeekday(int weekdayNumber, bool selected)

Parameters

NameTypeDescription
weekdayNumber int

The day of the week. This must be one of the Weekday values

selected bool

true to select the specified day, false to deselect it.

Remarks

Note that the adTempus Weekday enum used here uses different values than the Windows System.DayOfWeek.

WriteToConfigurationReport(IADTObjectConfigurationReportWriter)

Writes the object and any contained objects to a configuration report

public override void WriteToConfigurationReport(IADTObjectConfigurationReportWriter reportBuilder)

Parameters

NameTypeDescription
reportBuilder IADTObjectConfigurationReportWriter

The report builder to write the object to.

Inherited Members