首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >EWS在Appointment.Resources中Appointment.Bind之后没有资源

EWS在Appointment.Resources中Appointment.Bind之后没有资源
EN

Stack Overflow用户
提问于 2015-01-23 14:41:40
回答 1查看 1.7K关注 0票数 0

我使用EWS托管API来加载特定房间资源的约会,并通过WCF发布它,供平板设备使用。

我想取消会议室预订,如果组织者在15分钟后没有执行特定的行动,会议将开始。

由于tablet设备只有用于标识事件的StoreId属性,所以我实现了以下代码:

代码语言:javascript
运行
复制
public bool CancelMeeting(string appointmentId, string roomEmail)
    {
        try
        {
            var service = GetExchangeService();
            var ai = new AlternateId[1];
            ai[0] = new AlternateId();
            ai[0].UniqueId = appointmentId;
            ai[0].Format = IdFormat.HexEntryId;
            ai[0].Mailbox = roomEmail;
            ServiceResponseCollection<ConvertIdResponse> cvtresp = service.ConvertIds(ai, IdFormat.EwsId);
            var appointment = Appointment.Bind(service, ((AlternateId)cvtresp[0].ConvertedId).UniqueId);

            if (appointment.Resources.Count != 0)
                appointment.Resources.RemoveAt(0);

            appointment.Location = string.Empty;

            appointment.Save(SendInvitationsMode.SendOnlyToAll);
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }
    }

然而,

代码语言:javascript
运行
复制
if (appointment.Resources.Count != 0)
    appointment.Resources.RemoveAt(0);

在此代码中,appointment.Resources.Count始终为0。根据这篇文章(Can't Retrieve Resources (rooms) from Exchange Web Services),您需要告诉EWS具体包括参考资料。如何指定在使用Appointment.Bind时包含资源?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-26 15:44:50

就像你联系的那篇文章一样。使用AppointmentSchema.Resources属性创建属性集,并将其传递给绑定方法。

代码语言:javascript
运行
复制
PropertySet includeResources = new PropertySet(BasePropertySet.FirstClassProperties, AppointmentSchema.Resources);
var appointment = Appointment.Bind(service, ((AlternateId)cvtresp[0].ConvertedId).UniqueId, includeResources);

更新:

看上去你在看房间的日历,而不是组织者。在房间的日历里你就看不到资源了。资源仅在组织者的日历中可见。这是因为它们是作为BCC收件人实现的。此外,请记住,从房间的约会副本中移除某些东西不会从其他任何人的邮箱中删除,所以这可能不是最好的方法。相反,您可能想要拒绝会议,这将向组织者发送拒绝通知,并将会议从会议室日历中删除。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28112296

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档