Aspose::Email::Calendar::Recurrences::ByDay Class Reference

Represents Nth occurrence (or all occurrences) of the specified day of the week. More...

Inherits Object.

Public Member Functions

int32_t get_NthOccurrence () const
 Gets the nth occurrence of the day of the week. More...
 
void set_NthOccurrence (int32_t value)
 Sets the nth occurrence of the day of the week. More...
 
System::DayOfWeek get_DayOfWeek () const
 Gets the day of the week. More...
 
void set_DayOfWeek (System::DayOfWeek value)
 Sets the day of the week. More...
 
bool get_IsAllOccurrences ()
 Returns True when NthOccurrence is zero (meaning all occurrences of this day of week). More...
 
 ByDay (System::DayOfWeek dayOfWeek)
 Initializes a new instance of ByDay class. More...
 
 ByDay (int32_t nthOccurrence, System::DayOfWeek dayOfWeek)
 Initializes a new instance of ByDay class. More...
 
bool Equals (System::SharedPtr< System::Object > obj) override
 Determines whether the specified Object is equal to the current Object. More...
 
int32_t GetHashCode () const override
 GetHashCode returns a hash function for this object. More...
 

Protected Member Functions

virtual bool Equals_ (System::SharedPtr< ByDay > other)
 Determines whether the specified ByDay is equal to this instance. More...
 
virtual ~ByDay ()
 

Detailed Description

Represents Nth occurrence (or all occurrences) of the specified day of the week.

Corresponds to one day of the week specified in the BYDAY part of a recurrence rule.

Can be used in a monthly or yearly recurrence rule to specify Nth occurrence (or all occurrences) of the specified day of the week in a month or year.

BYDAY=MO represents all Mondays of the month or year. To represent all occurrences, set NthOccurrence to 0.

BYDAY=2MO represents 2nd Monday in a month or year.

BYDAY=-1MO represents the last Monday of a month or year.

Constructor & Destructor Documentation

◆ ByDay() [1/2]

Aspose::Email::Calendar::Recurrences::ByDay::ByDay ( System::DayOfWeek  dayOfWeek)

Initializes a new instance of ByDay class.

Parameters
dayOfWeekA day of the week.

◆ ByDay() [2/2]

Aspose::Email::Calendar::Recurrences::ByDay::ByDay ( int32_t  nthOccurrence,
System::DayOfWeek  dayOfWeek 
)

Initializes a new instance of ByDay class.

Parameters
nthOccurrenceThe nth occurrence of the day of the week.
dayOfWeekA day of the week.

◆ ~ByDay()

virtual Aspose::Email::Calendar::Recurrences::ByDay::~ByDay ( )
protectedvirtual

Member Function Documentation

◆ Equals()

bool Aspose::Email::Calendar::Recurrences::ByDay::Equals ( System::SharedPtr< System::Object >  obj)
override

Determines whether the specified Object is equal to the current Object.

Parameters
objThe Object to compare with the current Object.
Returns
Returns a boolean indicating if the passed in object obj is Equal to this.

◆ Equals_()

virtual bool Aspose::Email::Calendar::Recurrences::ByDay::Equals_ ( System::SharedPtr< ByDay other)
protectedvirtual

Determines whether the specified ByDay is equal to this instance.

Parameters
otherThe ByDay to compare with this instance.
Returns
true if the specified ByDay is equal to this instance; otherwise, false.

◆ get_DayOfWeek()

System::DayOfWeek Aspose::Email::Calendar::Recurrences::ByDay::get_DayOfWeek ( ) const

Gets the day of the week.

◆ get_IsAllOccurrences()

bool Aspose::Email::Calendar::Recurrences::ByDay::get_IsAllOccurrences ( )

Returns True when NthOccurrence is zero (meaning all occurrences of this day of week).

◆ get_NthOccurrence()

int32_t Aspose::Email::Calendar::Recurrences::ByDay::get_NthOccurrence ( ) const

Gets the nth occurrence of the day of the week.

Valid range for this property is from -53 to 53.

Positive values represent Nth occurrence from the beginning of the period, for example NthOccurrence = 1, represents 1st occurrence of the day of the week.

Negative values represent Nth occurrence from the end of the period, for example NthOccurrence = -1, represents last occurrence of the day of the week.

When NthOccurrence is zero, it represents all occurrences of the specified day of the week. For example, BYDAY=MO has NthOccurrence zero and represents all Mondays in the set.

◆ GetHashCode()

int32_t Aspose::Email::Calendar::Recurrences::ByDay::GetHashCode ( ) const
override

GetHashCode returns a hash function for this object.

Returns
Returns a hash function for this object.

◆ set_DayOfWeek()

void Aspose::Email::Calendar::Recurrences::ByDay::set_DayOfWeek ( System::DayOfWeek  value)

Sets the day of the week.

◆ set_NthOccurrence()

void Aspose::Email::Calendar::Recurrences::ByDay::set_NthOccurrence ( int32_t  value)

Sets the nth occurrence of the day of the week.

Valid range for this property is from -53 to 53.

Positive values represent Nth occurrence from the beginning of the period, for example NthOccurrence = 1, represents 1st occurrence of the day of the week.

Negative values represent Nth occurrence from the end of the period, for example NthOccurrence = -1, represents last occurrence of the day of the week.

When NthOccurrence is zero, it represents all occurrences of the specified day of the week. For example, BYDAY=MO has NthOccurrence zero and represents all Mondays in the set.