Show / Hide Table of Contents

Class iCalendarUtility

Inheritance
Object
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.dll
Syntax
public static class iCalendarUtility

Methods

AddParticipants(Calendar, AppointmentRow[])

Declaration
public static void AddParticipants(this Calendar calendar, params AppointmentRow[] participantRows)
Parameters
Type Name Description
Ical.Net.Calendar calendar
AppointmentRow[] participantRows

AddParticipants(CalendarEvent, AppointmentRow[])

Declaration
public static void AddParticipants(this CalendarEvent calEvent, params AppointmentRow[] participantRows)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow[] participantRows

ClearParticipants(Calendar, Boolean, Int32[])

Declaration
public static void ClearParticipants(this Calendar calendar, bool preserveOrganizerAttendee = true, params int[] personIds)
Parameters
Type Name Description
Ical.Net.Calendar calendar
Boolean preserveOrganizerAttendee
Int32[] personIds

ClearParticipants(CalendarEvent, Boolean, Int32[])

Declaration
public static void ClearParticipants(this CalendarEvent calEvent, bool preserveOrganizerAttendee = true, params int[] personIds)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
Boolean preserveOrganizerAttendee
Int32[] personIds

ConvertToCalDateTimeUTC(DateTime, Nullable<DateTime>)

Declaration
public static CalDateTime ConvertToCalDateTimeUTC(DateTime dt, DateTime? start = default(DateTime? ))
Parameters
Type Name Description
DateTime dt
Nullable<DateTime> start
Returns
Type Description
Ical.Net.DataTypes.CalDateTime

ConvertToUTC(DateTime)

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

CreateCalendar(String, Nullable<DateTime>)

Creates a calendar-object with default values.

Declaration
public static Calendar CreateCalendar(string method = "REQUEST", DateTime? start = default(DateTime? ))
Parameters
Type Name Description
String method
Nullable<DateTime> start
Returns
Type Description
Ical.Net.Calendar

CreateCalendarEvent(AppointmentRow, String, AppointmentRow[])

Generates a calendarevent-object, and populates it with values from the organizer-appointment, and given optional parameters. The organizer-associate is added as an attendee.

Declaration
public static CalendarEvent CreateCalendarEvent(this AppointmentRow organizerAppointment, string comment = null, AppointmentRow[] participants = null)
Parameters
Type Name Description
AppointmentRow organizerAppointment
String comment
AppointmentRow[] participants
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateCancellation(AppointmentRow, AppointmentRow[])

Declaration
public static Calendar CreateCancellation(this AppointmentRow organizerAppointment, AppointmentRow[] participants = null)
Parameters
Type Name Description
AppointmentRow organizerAppointment
AppointmentRow[] participants
Returns
Type Description
Ical.Net.Calendar

CreateDeclineCalendar(Calendar, Attendee, String)

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

Declaration
public static Calendar CreateDeclineCalendar(Calendar invitation, Attendee decliningAttendee, string declineComment)
Parameters
Type Name Description
Ical.Net.Calendar invitation
Ical.Net.DataTypes.Attendee decliningAttendee
String declineComment
Returns
Type Description
Ical.Net.Calendar

CreateEmail(Calendar, MailEnvelope, CalMethod, String, String)

Declaration
public static MailItem CreateEmail(this Calendar calendar, MailEnvelope envelope, CalMethod method, string subjectPrefix = null, string description = null)
Parameters
Type Name Description
Ical.Net.Calendar calendar
SuperOffice.CRM.Mail.MailEnvelope envelope
CalMethod method
String subjectPrefix
String description
Returns
Type Description
SuperOffice.CRM.Mail.MailItem

CreateEmail(MailEnvelope, CalMethod, String, String)

Declaration
public static MailItem CreateEmail(MailEnvelope envelope, CalMethod method, string subject, string description)
Parameters
Type Name Description
SuperOffice.CRM.Mail.MailEnvelope envelope
CalMethod method
String subject
String description
Returns
Type Description
SuperOffice.CRM.Mail.MailItem

CreateEmailAttachment(Calendar)

Declaration
public static MailAttachment CreateEmailAttachment(this Calendar calendar)
Parameters
Type Name Description
Ical.Net.Calendar calendar
Returns
Type Description
SuperOffice.CRM.Mail.MailAttachment

CreateIcalFromAppointmentUpdate(Int32, Boolean)

Method to generate ICS data from appointment

Declaration
public static string CreateIcalFromAppointmentUpdate(int i_AppointmentId, bool isCancel)
Parameters
Type Name Description
Int32 i_AppointmentId
Boolean isCancel
Returns
Type Description
String

Returns null if calendar-creation failed.

CreateInvitation(AppointmentRow, Nullable<DateTime>, Nullable<DateTime>, AppointmentRow[])

Generates a calendar object with values from the organizerAppointment. A new unique UID is generated, and a corresponding row in the invitation table is created.

Declaration
public static Calendar CreateInvitation(this AppointmentRow organizerAppointment, DateTime? recurrenceStartDate, DateTime? recurrenceEndDate, AppointmentRow[] participants = null)
Parameters
Type Name Description
AppointmentRow organizerAppointment
Nullable<DateTime> recurrenceStartDate
Nullable<DateTime> recurrenceEndDate
AppointmentRow[] participants
Returns
Type Description
Ical.Net.Calendar

CreateInvitationIcal(Int32, String, String)

DO NOT REMOVE! USED BY WINDOWS CLIENT! CONSULT WITH WIN-TEAM BEFORE REMOVAL!

Declaration
public static MailAttachment CreateInvitationIcal(int i_AppointmentId, string method, string participantStatus = "ACCEPTED")
Parameters
Type Name Description
Int32 i_AppointmentId
String method
String participantStatus
Returns
Type Description
SuperOffice.CRM.Mail.MailAttachment

Returns null if calendar-creation failed.

CreateOnlyThisEvent(InvitationRecordData, AppointmentRow, AppointmentRow[], Boolean)

Declaration
public static CalendarEvent CreateOnlyThisEvent(InvitationRecordData subSeriesRoot, AppointmentRow row, AppointmentRow[] participants, bool isUpdate = false)
Parameters
Type Name Description
InvitationRecordData subSeriesRoot
AppointmentRow row
AppointmentRow[] participants
Boolean isUpdate
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateOnlyThisUpdateEvent(InvitationRecordData, AppointmentRow, AppointmentRow[])

Declaration
public static CalendarEvent CreateOnlyThisUpdateEvent(InvitationRecordData subSeriesRoot, AppointmentRow row, AppointmentRow[] participants)
Parameters
Type Name Description
InvitationRecordData subSeriesRoot
AppointmentRow row
AppointmentRow[] participants
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateOrganizerEnvelope(CalendarEvent)

Declaration
public static MailEnvelope CreateOrganizerEnvelope(this CalendarEvent calendarEvent)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calendarEvent
Returns
Type Description
SuperOffice.CRM.Mail.MailEnvelope

CreateReply(AppointmentRow, AssociateRow, String, String)

Declaration
public static Calendar CreateReply(this AppointmentRow organizerAppointment, AssociateRow participant, string participantStatus = "ACCEPTED", string comment = null)
Parameters
Type Name Description
AppointmentRow organizerAppointment
AssociateRow participant
String participantStatus
String comment
Returns
Type Description
Ical.Net.Calendar

CreateThisAndForwardEvent(AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[], Func<CalendarEvent, (String uid, Int32 sequence, String organizerEmail)>)

Declaration
public static CalendarEvent CreateThisAndForwardEvent(AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows, Func<CalendarEvent, (string uid, int sequence, string organizerEmail)> uidAndSequenceFunc)
Parameters
Type Name Description
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
Func<Ical.Net.CalendarComponents.CalendarEvent, ValueTuple<String, Int32, String>> uidAndSequenceFunc
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateThisAndForwardInvitationEvent(AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[])

Declaration
public static CalendarEvent CreateThisAndForwardInvitationEvent(AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows)
Parameters
Type Name Description
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateThisAndForwardUpdateEvent(InvitationRecordData, AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[])

Declaration
public static CalendarEvent CreateThisAndForwardUpdateEvent(InvitationRecordData invitationRecord, AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows)
Parameters
Type Name Description
InvitationRecordData invitationRecord
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateThisAndForwardUpdateEvent(String, AppointmentRow, DateTime, DateTime, DateTime, AppointmentRow[])

Declaration
public static CalendarEvent CreateThisAndForwardUpdateEvent(string uid, AppointmentRow row, DateTime start, DateTime end, DateTime until, AppointmentRow[] participantRows)
Parameters
Type Name Description
String uid
AppointmentRow row
DateTime start
DateTime end
DateTime until
AppointmentRow[] participantRows
Returns
Type Description
Ical.Net.CalendarComponents.CalendarEvent

CreateUpdate(AppointmentRow, Nullable<DateTime>, AppointmentRow[])

Declaration
public static Calendar CreateUpdate(this AppointmentRow organizerAppointment, DateTime? recurringStartDate = default(DateTime? ), AppointmentRow[] participants = null)
Parameters
Type Name Description
AppointmentRow organizerAppointment
Nullable<DateTime> recurringStartDate
AppointmentRow[] participants
Returns
Type Description
Ical.Net.Calendar

GetAllDayPreferenceInSeconds()

Declaration
public static (int startInSeconds, int endInSeconds) GetAllDayPreferenceInSeconds()
Returns
Type Description
ValueTuple<Int32, Int32>

GetAllMotherAppointmentIdsOfRecurrenceRuleId(Int32)

Declaration
public static List<int> GetAllMotherAppointmentIdsOfRecurrenceRuleId(int recurrenceRuleId)
Parameters
Type Name Description
Int32 recurrenceRuleId
Returns
Type Description
List<Int32>

GetCalendar(String)

Loads calendar data and attempts to fix broken calendar

Declaration
public static Calendar GetCalendar(string calendarData)
Parameters
Type Name Description
String calendarData
Returns
Type Description
Ical.Net.Calendar

GetEmailAddress(Attendee)

Declaration
public static string GetEmailAddress(this Attendee attendee)
Parameters
Type Name Description
Ical.Net.DataTypes.Attendee attendee
Returns
Type Description
String

GetEmailAddress(Organizer)

Declaration
public static string GetEmailAddress(this Organizer organizer)
Parameters
Type Name Description
Ical.Net.DataTypes.Organizer organizer
Returns
Type Description
String

GetEmailAddressFromUri(Uri)

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

GetEventStatus(AppointmentRow)

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

GetParticipationStatus(Appointment)

Declaration
public static string GetParticipationStatus(Appointment appointment)
Parameters
Type Name Description
Appointment appointment
Returns
Type Description
String

GetParticipationStatus(AppointmentRow)

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

GetPersonEmailAddress(Person)

Declaration
public static string GetPersonEmailAddress(Person person)
Parameters
Type Name Description
Person person
Returns
Type Description
String

GetPersonFullName(Person)

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

GetSummaryAndDescription(Appointment)

Declaration
public static (string summary, string description) GetSummaryAndDescription(Appointment appointment)
Parameters
Type Name Description
Appointment appointment
Returns
Type Description
ValueTuple<String, String>

GetSummaryAndDescription(Int32, String)

Declaration
public static (string summary, string description) GetSummaryAndDescription(int textRowId, string videomeetingUrl = null)
Parameters
Type Name Description
Int32 textRowId
String videomeetingUrl
Returns
Type Description
ValueTuple<String, String>

GetSummaryAndDescription(String, String)

Declaration
public static (string summary, string description) GetSummaryAndDescription(string appointmentText, string videomeetingUrl = null)
Parameters
Type Name Description
String appointmentText
String videomeetingUrl
Returns
Type Description
ValueTuple<String, String>

GetWeekdays(List<WeekDay>)

Gets the SuperOffice Weekdays equivalent from iCalendar recurrence weekdays

Declaration
public static Weekday GetWeekdays(List<WeekDay> calendarWeek)
Parameters
Type Name Description
List<Ical.Net.DataTypes.WeekDay> calendarWeek

Recurrence info about which days in a week have events

Returns
Type Description
Weekday

SuperOffice appointment weekdays

GetWindowsTimeZoneName(Nullable<DateTime>)

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

Declaration
public static string GetWindowsTimeZoneName(DateTime? start = default(DateTime? ))
Parameters
Type Name Description
Nullable<DateTime> start
Returns
Type Description
String

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

SerializeToString(Calendar)

Declaration
public static string SerializeToString(this Calendar calendar)
Parameters
Type Name Description
Ical.Net.Calendar calendar
Returns
Type Description
String

SetAllDateTimesFromAppointment(CalendarEvent, AppointmentRow)

All times are "normalized" to UTC+0.

Declaration
public static void SetAllDateTimesFromAppointment(this CalendarEvent calEvent, AppointmentRow appointment)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow appointment

SetCreatedFromAppointment(CalendarEvent, AppointmentRow)

Declaration
public static void SetCreatedFromAppointment(this CalendarEvent calEvent, AppointmentRow appointment)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow appointment

SetEndFromAppointment(CalendarEvent, AppointmentRow)

Declaration
public static void SetEndFromAppointment(this CalendarEvent calEvent, AppointmentRow appointment)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow appointment

SetLastModifiedFromAppointment(CalendarEvent, AppointmentRow)

Declaration
public static void SetLastModifiedFromAppointment(this CalendarEvent calEvent, AppointmentRow appointment)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow appointment

SetRecurrenceId(CalendarEvent, AppointmentRow, DateTime)

Sets the RecurrenceId of the CalendarEvent, combining the date-component of the appointment's DoBy, and the value of recurrenceIdTimeComponent 'stime-component.

Declaration
public static void SetRecurrenceId(this CalendarEvent calendarEvent, AppointmentRow appointmentRow, DateTime recurrenceIdTimeComponent)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calendarEvent
AppointmentRow appointmentRow
DateTime recurrenceIdTimeComponent

SetRecurrenceRule(CalendarEvent, RecurrenceRuleRow)

Declaration
public static void SetRecurrenceRule(this CalendarEvent calEvent, RecurrenceRuleRow recurrenceRuleRow)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
RecurrenceRuleRow recurrenceRuleRow

SetStartFromAppointment(CalendarEvent, AppointmentRow)

Declaration
public static void SetStartFromAppointment(this CalendarEvent calEvent, AppointmentRow appointment)
Parameters
Type Name Description
Ical.Net.CalendarComponents.CalendarEvent calEvent
AppointmentRow appointment

ToUtf8ByteStream(Calendar)

Returns the calendar as a byte array, encoded in UTF8. Special handling of UTF8-BOM.

Declaration
public static byte[] ToUtf8ByteStream(this Calendar calendar)
Parameters
Type Name Description
Ical.Net.Calendar calendar
Returns
Type Description
Byte[]
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top