c#Exchange Service CalendarEvent对象转换为约会 [英] c# Exchange Service CalendarEvent object convert to appointment

查看:67
本文介绍了c#Exchange Service CalendarEvent对象转换为约会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我通过Exchange Serrver Managed Api连接到Exchange Server.我正在获取所有房间和日历活动,但是日历活动无法提供详细信息.我猜我必须将日历事件对象转换为附件对象.这是可能的?我该怎么办?
请帮帮我..

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);
            }

推荐答案

我猜我必须将日历事件对象转换为附件对象.有可能
AFAIK,您不能.两者都是两个不同的实体,您不能将其强制转换为约会对象.
ı 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.


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;
       }




******使用CalendarEvent商店ID获取约会对象*******




******get appointment object using calendarevent store id*******

Appointment appointment = GetAppointment(smtpaddress, calendarEvent);


这篇关于c#Exchange Service CalendarEvent对象转换为约会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆