Show / Hide Table of Contents

Class CalendarUtility

Inheritance
object
CalendarUtility
Implements
ICalendarUtility
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Util
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class CalendarUtility : ICalendarUtility

Constructors

CalendarUtility()

Declaration
public CalendarUtility()

Methods

ConvertToCalDateTimeUTC(DateTime, DateTime?)

Declaration
public CalDateTime ConvertToCalDateTimeUTC(DateTime dt, DateTime? start = null)
Parameters
Type Name Description
DateTime dt
DateTime? start
Returns
Type Description
CalDateTime

ConvertToUTC(DateTime)

Declaration
public DateTime ConvertToUTC(DateTime dt)
Parameters
Type Name Description
DateTime dt
Returns
Type Description
DateTime

CreateAttendeeFromAppointmentRowAsync(AppointmentRow, string, string, CancellationToken)

Declaration
public Task<Attendee> CreateAttendeeFromAppointmentRowAsync(AppointmentRow appointment, string email = null, string role = "REQ-PARTICIPANT", CancellationToken cancellationToken = default)
Parameters
Type Name Description
AppointmentRow appointment
string email
string role
CancellationToken cancellationToken
Returns
Type Description
Task<Attendee>

CreateCalendar(string, DateTime?)

Creates a calendar-object with default values.

Declaration
public Calendar CreateCalendar(string method = "REQUEST", DateTime? start = null)
Parameters
Type Name Description
string method
DateTime? start
Returns
Type Description
Calendar

CreateDeclineCalendar(Calendar, Attendee, string)

Creating a decline-calendar to be used when declining initial unknown or recurring invitations

Declaration
public Calendar CreateDeclineCalendar(Calendar invitation, Attendee decliningAttendee, string declineComment)
Parameters
Type Name Description
Calendar invitation
Attendee decliningAttendee
string declineComment
Returns
Type Description
Calendar

CreateEmail(MailEnvelope, CalMethod, string, string)

Declaration
public MailItem CreateEmail(MailEnvelope envelope, CalMethod method, string subject, string description)
Parameters
Type Name Description
MailEnvelope envelope
CalMethod method
string subject
string description
Returns
Type Description
MailItem

CreateIcalFromAppointmentUpdateAsync(int, bool, CancellationToken)

Method to generate ICS data from appointment

Declaration
public Task<string> CreateIcalFromAppointmentUpdateAsync(int i_AppointmentId, bool isCancel, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int i_AppointmentId
bool isCancel
CancellationToken cancellationToken
Returns
Type Description
Task<string>

Returns null if calendar-creation failed.

CreateOnlyThisEventAsync(InvitationRecordData, AppointmentRow, AppointmentRow[], bool, CancellationToken)

Declaration
public Task<CalendarEvent> CreateOnlyThisEventAsync(InvitationRecordData subSeriesRoot, AppointmentRow row, AppointmentRow[] participants, bool isUpdate = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
InvitationRecordData subSeriesRoot
AppointmentRow row
AppointmentRow[] participants
bool isUpdate
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

CreateOnlyThisUpdateEventAsync(InvitationRecordData, AppointmentRow, AppointmentRow[], CancellationToken)

Declaration
public Task<CalendarEvent> CreateOnlyThisUpdateEventAsync(InvitationRecordData subSeriesRoot, AppointmentRow row, AppointmentRow[] participants, CancellationToken cancellationToken = default)
Parameters
Type Name Description
InvitationRecordData subSeriesRoot
AppointmentRow row
AppointmentRow[] participants
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

CreateThisAndForwardEventAsync(AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[], Func<CalendarEvent, Task<(string uid, int sequence, string organizerEmail)>>, CancellationToken)

Declaration
public Task<CalendarEvent> CreateThisAndForwardEventAsync(AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows, Func<CalendarEvent, Task<(string uid, int sequence, string organizerEmail)>> uidAndSequenceFunc, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
Func<CalendarEvent, Task<(string uid, int sequence, string organizerEmail)>> uidAndSequenceFunc
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

CreateThisAndForwardInvitationEventAsync(AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[], string, CancellationToken)

Declaration
public Task<CalendarEvent> CreateThisAndForwardInvitationEventAsync(AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows, string templateLanguage, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
string templateLanguage
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

CreateThisAndForwardUpdateEventAsync(InvitationRecordData, AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[], CancellationToken)

Declaration
public Task<CalendarEvent> CreateThisAndForwardUpdateEventAsync(InvitationRecordData invitationRecord, AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows, CancellationToken cancellationToken = default)
Parameters
Type Name Description
InvitationRecordData invitationRecord
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

CreateThisAndForwardUpdateEventAsync(string, AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[], CancellationToken)

Declaration
public Task<CalendarEvent> CreateThisAndForwardUpdateEventAsync(string uid, AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string uid
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
CancellationToken cancellationToken
Returns
Type Description
Task<CalendarEvent>

GetAllDayPreferenceInSecondsAsync(CancellationToken)

Declaration
public Task<(int startInSeconds, int endInSeconds)> GetAllDayPreferenceInSecondsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<(int startInSeconds, int endInSeconds)>

GetAllMotherAppointmentIdsOfRecurrenceRuleIdAsync(int, CancellationToken)

Declaration
public Task<List<int>> GetAllMotherAppointmentIdsOfRecurrenceRuleIdAsync(int recurrenceRuleId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recurrenceRuleId
CancellationToken cancellationToken
Returns
Type Description
Task<List<int>>

GetCalendar(string)

Loads calendar data and attempts to fix broken calendar

Declaration
public Calendar GetCalendar(string calendarData)
Parameters
Type Name Description
string calendarData
Returns
Type Description
Calendar

GetEmailAddressFromUri(Uri)

Declaration
public string GetEmailAddressFromUri(Uri uri)
Parameters
Type Name Description
Uri uri
Returns
Type Description
string

GetEventStatus(AppointmentRow)

Declaration
public string GetEventStatus(AppointmentRow organizerAppointment)
Parameters
Type Name Description
AppointmentRow organizerAppointment
Returns
Type Description
string

GetParticipationStatus(AppointmentRow)

Declaration
public string GetParticipationStatus(AppointmentRow appointment)
Parameters
Type Name Description
AppointmentRow appointment
Returns
Type Description
string

GetPersonEmailAddressAsync(Person, CancellationToken)

Declaration
public Task<string> GetPersonEmailAddressAsync(Person person, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Person person
CancellationToken cancellationToken
Returns
Type Description
Task<string>

GetPersonFullName(Person)

Declaration
public string GetPersonFullName(Person person)
Parameters
Type Name Description
Person person
Returns
Type Description
string

GetSummaryAndDescription(string, string)

Declaration
public (string summary, string description) GetSummaryAndDescription(string appointmentText, string videomeetingUrl = null)
Parameters
Type Name Description
string appointmentText
string videomeetingUrl
Returns
Type Description
(string summary, string description)

GetSummaryAndDescriptionAsync(AppointmentRow, string, CancellationToken)

Declaration
public Task<(string summary, string description)> GetSummaryAndDescriptionAsync(AppointmentRow row, string videomeetingUrl = null, CancellationToken cancellationToken = default)
Parameters
Type Name Description
AppointmentRow row
string videomeetingUrl
CancellationToken cancellationToken
Returns
Type Description
Task<(string value, string tooltip)>

GetWeekdays(List<WeekDay>)

Gets the SuperOffice Weekdays equivalent from iCalendar recurrence weekdays

Declaration
public Weekday GetWeekdays(List<WeekDay> calendarWeek)
Parameters
Type Name Description
List<WeekDay> calendarWeek

Recurrence info about which days in a week have events

Returns
Type Description
Weekday

SuperOffice appointment weekdays

GetWindowsTimeZoneName(DateTime?)

Attempts to map database-tz country-code for current principal to windows-timezone name.

Declaration
public string GetWindowsTimeZoneName(DateTime? start = null)
Parameters
Type Name Description
DateTime? start
Returns
Type Description
string

Empty string if no match is found, otherwise returns the Windows-id of the timezone.

Implements

ICalendarUtility

Extension Methods

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