private void ProcessNewMeetingItem(Outlook.MeetingItem meetingItem) { string vCalId = meetingItem.GetVCalId(); if (CrmId.IsValid(vCalId) && RestAPIWrapper.GetEntry(MeetingsSynchroniser.DefaultCrmModule, vCalId, new string[] { "id" }) != null) { meetingItem.GetAssociatedAppointment(false).SetCrmId(CrmId.Get(vCalId)); } }
/// <summary> /// A meeting invitation is being sent; if we're going to sync it we should do so now and add the accept/decline links to the body before it actually is sent. /// </summary> /// <param name="meetingItem">The meeting whose invite(s) are being despatched.</param> /// <returns>true if the item was not null.</returns> private bool ProcessSentMeetingInvite(Outlook.MeetingItem meetingItem) { if (meetingItem != null) { Outlook.AppointmentItem appointment = meetingItem.GetAssociatedAppointment(false); var syncState = this.appointmentSynchroniser.AddOrGetSyncState(appointment); new SyncWaitDialog( this.appointmentSynchroniser, syncState, AppointmentSyncing.CrmModule, this.log) .ShowDialog(); } return(true); }
private static void UpdateAppointmentSubject(Outlook.MeetingItem item, string subject) { Outlook.AppointmentItem appointment = null; try { appointment = item.GetAssociatedAppointment(false); appointment.Subject = subject; } finally { if (appointment != null) { Marshal.ReleaseComObject(appointment); } } }
/// <summary> /// Check meeting acceptances for the invitees of this `meeting`. /// </summary> /// <param name="meeting">The meeting.</param> /// <returns>the number of valid acceptance statuses found.</returns> public int UpdateMeetingAcceptances(Outlook.MeetingItem meeting) { return(meeting == null ? 0 : this.AddOrUpdateMeetingAcceptanceFromOutlookToCRM(meeting.GetAssociatedAppointment(false))); }
/// <summary> /// Extract the vCal uid from this MeetingItem, if available. /// </summary> /// <param name="item">A meeting item, which may relate to a meeting in CRM.</param> /// <returns>The vCal id if present, else the empty string.</returns> public static string GetVCalId(this Outlook.MeetingItem item) { return(item.GetAssociatedAppointment(false).GetVCalId()); }