和遗憾,获得真正的自由间为问题如何从Exchange EWS
我正尝试从我的Exchange服务器的所有免费客房(没有预订的)的一个贫穷的称号。事情是这样的我也得到我预订的房间,但没有人接受。
我想在预订房间后将它们从列表中排除。
这是我用来保存(后直预订房间
ExchangeService service;
//...code to new-up and config service
var request = new Appointment(service)
{
Subject = booking.Subject,
Start = booking.Start,
End = booking.End,
Location = booking.Room
};
request.RequiredAttendees.Add(booking.Person);
request.RequiredAttendees.Add(booking.Room);
request.Save(SendInvitationsMode.SendOnlyToAll);
要注意我试图调用request.Accept()的代码),但没有说“真的预订”房间。在Outlook中按下接受是唯一的“修复”。毫无疑问,我已经尝试了所有我能找到的关于这个问题的事情(我不经常与Exchange合作)。
然后代码获得免费客房
var rooms = service.GetRooms(locationAddress);
// all the meeting rooms at location
var rooms= rooms.Select(i => new AttendeeInfo { SmtpAddress = i.Address, AttendeeType = MeetingAttendeeType.Room });
// Get all availabilites from all rooms at given locations
var availability = service.GetUserAvailability(rooms, timeframe, AvailabilityData.FreeBusy);
foreach (var a in availability.AttendeesAvailability)
{
// Here we always get all the free rooms
// including the ones we booked earlier
// UNTIL somebody clicks accept in Outlook and then it does not appear here!?
}
我不能看到房间都标志着他们在Outlook中接受之前不同所以我不能区分它们,并拉出他们我不想要的。
我也真的认为那些房间不应该是可用的,所以必须有一些enum/tick/mark我可以把它放在房间之前,但我完全错过了它。
编辑
我真的不明白为什么没有用于AvailabilityData别无选择。 在GetUserAvailability方法枚举免费(仅FreeBusy,FreeBusyAndSuggestions和建议,但没有免费只!?)
我知道这是一个古老的一个,但我挣扎与GetUserAvailability只返回繁忙的信息...我想建议(RoomFinder)。任何线索? –
对不起我移动公司和不对EWS编程,所以我不幸没有任何答案给你 – Sturla