Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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..
 
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 29-Sep-12 3:12am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

ı 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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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*******
Appointment appointment = GetAppointment(smtpaddress, calendarEvent);
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 285
1 DamithSL 265
2 CPallini 195
3 Maciej Los 175
4 George Jonsson 170
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100