Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..

i am connected the Exchange Server by Exchange Serrver Managed Api. I m getting all rooms and calendar event but calendar event can not give me a detail information. ı guess i must convert calendar event object to appontment object. it s possible? How can I do it?
Please help me..

C#
foreach (CalendarEvent calendarEvent in attendeeAvailability.CalendarEvents)
            {
                Event newevent = new Event
                {
                    StartDate = calendarEvent.StartTime,
                    EndDate = calendarEvent.EndTime,
                    Subject = calendarEvent.Details == null ? @"N\A" : calendarEvent.Details.Subject,
                    ID = calendarEvent.Details == null ? @"N\A" : calendarEvent.Details.StoreId,
                };
                room.Events.Add(newevent);
            }
Posted

ı guess i must convert calendar event object to appontment object. it s possible
AFAIK, you cannot. Both are two different entities and you cannot cast it into Appointment object.
 
Share this answer
 
C#
private Appointment GetAppointment(string smtpaddress, CalendarEvent calendarEvent)
       {
           var convertedId = (AlternateId)_service.ConvertId(new AlternateId(IdFormat.HexEntryId, calendarEvent.Details.StoreId, smtpaddress), IdFormat.EwsId);
           var appointment = Appointment.Bind(_service, new ItemId(convertedId.UniqueId));
           return appointment;
       }



******get appointment object using calendarevent store id*******
C#
Appointment appointment = GetAppointment(smtpaddress, calendarEvent);
 
Share this answer
 
Comments
Member 11234893 12-Sep-18 3:25am    
So to convert a CalendarEvent StoreId into the appointment's EwsId I will need to know the smtpAddress of the Mailbox of the meeting organizer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900