Show / Hide Table of Contents

Class RecurrenceManager

The recurrence manager is used by the AppointmentMatrix to calculate recurrence patterns, modify appointment records and to maintain an encapsulated RecurrenceRuleRow.

Inheritance
Object
RecurrenceManager
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public class RecurrenceManager

Constructors

RecurrenceManager()

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)

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)

Declaration
[Obsolete("Not in use. Links are only added to the first appointment")]
public static void ApplyLinks(ActivityLinksHelper source, ActivityLinksHelper target)
Parameters
Type Name Description
ActivityLinksHelper source
ActivityLinksHelper target

ApplyUdefValues(EntityUdefHelper, EntityUdefHelper)

Declaration
public static void ApplyUdefValues(EntityUdefHelper source, EntityUdefHelper target)
Parameters
Type Name Description
EntityUdefHelper source
EntityUdefHelper target

BreakRecurrence()

Declaration
public void BreakRecurrence()

ConvertFromTimeZone(DateTime, Int32)

Declaration
public static DateTime ConvertFromTimeZone(DateTime date, int timeZoneID)
Parameters
Type Name Description
DateTime date
Int32 timeZoneID
Returns
Type Description
DateTime

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)

Declaration
public int GetDaysToMatchInPattern(DateTime date)
Parameters
Type Name Description
DateTime date
Returns
Type Description
Int32

GetDaysToMatchInPattern(DayOfWeek)

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()

Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo()
Returns
Type Description
RecurrenceInfo

GetDefaultRecurrenceInfo(DateTime)

Declaration
public static RecurrenceInfo GetDefaultRecurrenceInfo(DateTime date)
Parameters
Type Name Description
DateTime date
Returns
Type Description
RecurrenceInfo

GetEstimatedCount()

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)

Declaration
public static RecurrenceDate GetRecurrenceDate(Appointment appointment)
Parameters
Type Name Description
Appointment appointment
Returns
Type Description
RecurrenceDate

GetRecurrenceDate(AppointmentRow)

Declaration
public static RecurrenceDate GetRecurrenceDate(AppointmentRow appointment)
Parameters
Type Name Description
AppointmentRow appointment
Returns
Type Description
RecurrenceDate

GetRecurrenceDate(DateTime)

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)

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

OnAppointmentRowValueChanged(Appointment, TableRowBase, FieldInfo, Object, Object, Object)

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

OnLinksAdded(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow)

Declaration
public void OnLinksAdded(Appointment app, ActivityLinksHelper linksHelper, AppointmentRow parent, RelationsRow item)
Parameters
Type Name Description
Appointment app
ActivityLinksHelper linksHelper
AppointmentRow parent
RelationsRow item

OnLinksRemoved(Appointment, ActivityLinksHelper, AppointmentRow, RelationsRow)

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)

Declaration
public void OnSaved(bool bSucceeded, bool isRecurring)
Parameters
Type Name Description
Boolean bSucceeded
Boolean isRecurring

OnTextChange(Appointment, String, String, String)

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)

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)

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

Extension Methods

EnumUtil.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top