Class RecurrenceManager
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public class RecurrenceManager : Object
Constructors
RecurrenceManager()
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public RecurrenceManager()
RecurrenceManager(Appointment, IEnumerable<Appointment>)
Instantiate the recurrence manager with an existing RecurrenceRuleRow.
Declaration
public RecurrenceManager(Appointment bookingMaster, IEnumerable<Appointment> repetitions)
Parameters
Type | Name | Description |
---|---|---|
Appointment | bookingMaster | Master appointment entity for the appointment. |
IEnumerable<Appointment> | repetitions | Dates of recurring appointments. |
RecurrenceManager(RecurrenceInfo)
Instantiate a RecurrenceManager providing a new recurrence pattern.
Declaration
public RecurrenceManager(RecurrenceInfo recurrenceInfo)
Parameters
Type | Name | Description |
---|---|---|
RecurrenceInfo | recurrenceInfo | Information about the recurrence pattern. |
RecurrenceManager(DateTime)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public RecurrenceManager(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date |
Properties
Dates
Get or set the dates of the recurring appointments.
Declaration
public RecurrenceDate[] Dates { get; set; }
Property Value
Type | Description |
---|---|
RecurrenceDate[] |
IsRecurrencePatternChanged
Get if the recurrence pattern has been changed from the currently saved pattern.
This value will allways be false if the recurrence pattern has not yet been
insterted in the database.
Declaration
public bool IsRecurrencePatternChanged { get; }
Property Value
Type | Description |
---|---|
Boolean |
RecurrenceInfo
Get or set the current recurrence pattern.
Declaration
public RecurrenceInfo RecurrenceInfo { get; set; }
Property Value
Type | Description |
---|---|
RecurrenceInfo |
Methods
ApplyLinks(ActivityLinksHelper, ActivityLinksHelper)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static void ApplyLinks(ActivityLinksHelper source, ActivityLinksHelper target)
Parameters
Type | Name | Description |
---|---|---|
ActivityLinksHelper | source | |
ActivityLinksHelper | target |
ApplyUdefValues(EntityUdefHelper, EntityUdefHelper)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static void ApplyUdefValues(EntityUdefHelper source, EntityUdefHelper target)
Parameters
Type | Name | Description |
---|---|---|
EntityUdefHelper | source | |
EntityUdefHelper | target |
BreakRecurrence()
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void BreakRecurrence()
ConvertDayOfWeekToWeekday(DayOfWeek)
Converts the given integer to the corresponding Weekday enum (bit flag).
Declaration
public static Weekday ConvertDayOfWeekToWeekday(DayOfWeek day)
Parameters
Type | Name | Description |
---|---|---|
DayOfWeek | day |
Returns
Type | Description |
---|---|
Weekday | Returns an integer from 1-7 representing Monday-Sunday respectively. If the input does not match any known Weekday, it returns 0. |
ConvertFromTimeZone(DateTime, Int32)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static DateTime ConvertFromTimeZone(DateTime date, int timeZoneID)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | |
Int32 | timeZoneID |
Returns
Type | Description |
---|---|
DateTime |
ConvertWeekdayToInteger(Weekday)
Converts the Weekday enum to its corresponding integer representation.
Declaration
public static int ConvertWeekdayToInteger(Weekday weekday)
Parameters
Type | Name | Description |
---|---|---|
Weekday | weekday | The Weekday enum value to convert. |
Returns
Type | Description |
---|---|
Int32 | Returns an integer from 1-7 representing Monday-Sunday respectively. If the input does not match any known Weekday, it returns 0. |
CreateAppointmentForDate(Appointment, RecurrenceDate)
Create a new Appointment with new date information based on an existing instance of an Appointment.
Declaration
public static Appointment CreateAppointmentForDate(Appointment originalAppointment, RecurrenceDate date)
Parameters
Type | Name | Description |
---|---|---|
Appointment | originalAppointment | Original appointment to create a copy of with new date information. |
RecurrenceDate | date | New date information to apply on the newly created appointment record. |
Returns
Type | Description |
---|---|
Appointment |
Remarks
The appointment is cloned and modified using the UpdateAppointmentWithDate(Appointment, RecurrenceDate) method.
GetDayInMonth(Int32, DateTime)
Get the date for a day in a month.
Declaration
public static DateTime GetDayInMonth(int day, DateTime month)
Parameters
Type | Name | Description |
---|---|---|
Int32 | day | The day in the month. |
DateTime | month | Month |
Returns
Type | Description |
---|---|
DateTime | Date of the day in the month. |
GetDaysToMatchInPattern(DateTime)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public int GetDaysToMatchInPattern(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date |
Returns
Type | Description |
---|---|
Int32 |
GetDaysToMatchInPattern(DayOfWeek)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public int GetDaysToMatchInPattern(DayOfWeek dayOfWeek)
Parameters
Type | Name | Description |
---|---|---|
DayOfWeek | dayOfWeek |
Returns
Type | Description |
---|---|
Int32 |
GetDaysToMatchInPattern(DayOfWeek, Weekday)
Get Number of days until a match in the week pattern. Matching today is '0'.
Declaration
public static int GetDaysToMatchInPattern(DayOfWeek dayOfWeek, Weekday weekPattern)
Parameters
Type | Name | Description |
---|---|---|
DayOfWeek | dayOfWeek | Current day of week as used by DateTime. |
Weekday | weekPattern | Weekday pattern describing days in the week for recurrence. |
Returns
Type | Description |
---|---|
Int32 | Number of days until Match [0-6]. Today is 0. |
GetDefaultRecurrenceInfo()
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo()
Returns
Type | Description |
---|---|
RecurrenceInfo |
GetDefaultRecurrenceInfo(DateTime)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date |
Returns
Type | Description |
---|---|
RecurrenceInfo |
GetEstimatedCount()
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public int GetEstimatedCount()
Returns
Type | Description |
---|---|
Int32 |
GetFirstDate(DateTime)
Get the first date of a recurrence. The first date can be the same as the date provided.
Declaration
public DateTime GetFirstDate(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | First candidate for a date in a recurrence. |
Returns
Type | Description |
---|---|
DateTime | First valid date in a recurrence |
GetNextDate(DateTime)
Get the next date in a recurrence. Use GetFirstDate(DateTime) to get the initial date.
Declaration
public DateTime GetNextDate(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The previous date in recurrence. |
Returns
Type | Description |
---|---|
DateTime | The next date. The day after the provided date is the earliest date that will be returned. |
GetRecurrenceDate(Appointment)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static RecurrenceDate GetRecurrenceDate(Appointment appointment)
Parameters
Type | Name | Description |
---|---|---|
Appointment | appointment |
Returns
Type | Description |
---|---|
RecurrenceDate |
GetRecurrenceDate(AppointmentRow)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static RecurrenceDate GetRecurrenceDate(AppointmentRow appointment)
Parameters
Type | Name | Description |
---|---|---|
AppointmentRow | appointment |
Returns
Type | Description |
---|---|
RecurrenceDate |
GetRecurrenceDate(DateTime)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static RecurrenceDate GetRecurrenceDate(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date |
Returns
Type | Description |
---|---|
RecurrenceDate |
GetRecurrenceInfo(Appointment)
Get RecurrenceInfo from an appointment.
Declaration
public static RecurrenceInfo GetRecurrenceInfo(Appointment bookingMaster)
Parameters
Type | Name | Description |
---|---|---|
Appointment | bookingMaster |
Returns
Type | Description |
---|---|
RecurrenceInfo |
GetRecurrenceInfo(RecurrenceRuleRow, DateTime)
Get a recurrence info from a recurrence rule row in the database with corresponding doby
Declaration
public static RecurrenceInfo GetRecurrenceInfo(RecurrenceRuleRow ruleRow, DateTime doBy)
Parameters
Type | Name | Description |
---|---|---|
RecurrenceRuleRow | ruleRow | |
DateTime | doBy |
Returns
Type | Description |
---|---|
RecurrenceInfo |
GetWeekDayInMonth(Weekday, Int32, DateTime)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public static DateTime GetWeekDayInMonth(Weekday weekday, int week, DateTime month)
Parameters
Type | Name | Description |
---|---|---|
Weekday | weekday | |
Int32 | week | |
DateTime | month |
Returns
Type | Description |
---|---|
DateTime |
OnAgendaHTMLTextChange(Appointment, String, String, String)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnAgendaHTMLTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | persistedValue | |
String | currentValue | |
String | newValue |
OnAgendaTextChange(Appointment, String, String, String)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnAgendaTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | persistedValue | |
String | currentValue | |
String | newValue |
OnAppointmentRowValueChanged(Appointment, TableRowBase, FieldInfo, Object, Object, Object)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnAppointmentRowValueChanged(Appointment app, TableRowBase fieldOwner, FieldInfo field, object persistedValue, object currentValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
TableRowBase | fieldOwner | |
FieldInfo | field | |
Object | persistedValue | |
Object | currentValue | |
Object | newValue |
OnInternalNotesHtmlTextChange(Appointment, String, String, String)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnInternalNotesHtmlTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | persistedValue | |
String | currentValue | |
String | newValue |
OnInternalNotesTextChange(Appointment, String, String, String)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnInternalNotesTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | persistedValue | |
String | currentValue | |
String | newValue |
OnLinksAdded(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnLinksAdded(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
ActivityLinksHelper | linksHelper | |
AppointmentRow | parent | |
RelationsRow | item |
OnLinksEdited(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public RelationsRow OnLinksEdited(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
ActivityLinksHelper | linksHelper | |
AppointmentRow | parent | |
RelationsRow | item |
Returns
Type | Description |
---|---|
RelationsRow |
OnLinksRemoved(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnLinksRemoved(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
ActivityLinksHelper | linksHelper | |
AppointmentRow | parent | |
RelationsRow | item |
OnSaved(Boolean, Boolean)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnSaved(bool bSucceeded, bool isRecurring)
Parameters
Type | Name | Description |
---|---|---|
Boolean | bSucceeded | |
Boolean | isRecurring |
OnTextChange(Appointment, String, String, String)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnTextChange(Appointment app, string persistedValue, string currentValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | persistedValue | |
String | currentValue | |
String | newValue |
OnUdefValueChange(Appointment, String, Object, Object)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void OnUdefValueChange(Appointment app, string progId, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
Appointment | app | |
String | progId | |
Object | oldValue | |
Object | newValue |
PrepareForSave(Boolean, Boolean)
The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.
Declaration
public void PrepareForSave(bool isRecurring, bool updateStartDate)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isRecurring | |
Boolean | updateStartDate |
RecalculateDays()
Re-calculate the days in the containing RecurrenceInfo.
Declaration
public void RecalculateDays()
Examples
// Make some modifications to the RecurrenceInfo object.
recurrenceManager.RecalculateDays();
RecurrenceDate[] newDates = recurrenceManager.Days;
UpdateAppointmentWithDate(Appointment, RecurrenceDate)
Apply new date information on an appointment based on the provided date information.
Declaration
public static void UpdateAppointmentWithDate(Appointment appointment, RecurrenceDate date)
Parameters
Type | Name | Description |
---|---|---|
Appointment | appointment | Appointment record to modify. |
RecurrenceDate | date | Date information to apply on the appointment record. |
UpdateConflicts(Int32, Int32, TimeSpan, TimeSpan, ParticipantInfo[])
Update the recurrence dates with conflict and letter day information, based on a list of participants.
Declaration
public void UpdateConflicts(int excludedAppointmentId, int excludedRecurrenceRuleId, TimeSpan startTime, TimeSpan endTime, params ParticipantInfo[] participants)
Parameters
Type | Name | Description |
---|---|---|
Int32 | excludedAppointmentId | |
Int32 | excludedRecurrenceRuleId | |
TimeSpan | startTime | |
TimeSpan | endTime | |
ParticipantInfo[] | participants |