c# - 计算已接受 EWS session 的与会者人数

标签 c# exchange-server exchangewebservices

我正在努力统计通过 EWS 接受 session 邀请的与会者人数。

我可以通过模拟查看组织者 session 并计算 session 所需的与会者人数。

        //Determine User to impersonat
        string impersonated_email = "user@domain";
        service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, impersonated_email);

        //Bind User Calendar
        FolderId UserCalendarId = new FolderId(WellKnownFolderName.Calendar, impersonated_email);
        CalendarFolder UserCalendar = CalendarFolder.Bind(service, UserCalendarId);

        // Initialize values for the start and end times, and the number of appointments to retrieve.
        DateTime startDate = DateTime.Now.AddDays(0);
        DateTime endDate = startDate.AddDays(1);

        // Execute the search in the calendar folder and return the view
        CalendarView userCalendar = new CalendarView(startDate, endDate);
        userCalendar.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
        FindItemsResults<Appointment> apt = service.FindAppointments(WellKnownFolderName.Calendar, userCalendar);

        foreach (Item item in apt.Items)
        {
            //Console.WriteLine(item.Subject);
            ServiceResponseCollection<GetItemResponse> myColl = service.BindToItems(new[] { new ItemId(item.Id.UniqueId) }, userCalendar.PropertySet);
            foreach (GetItemResponse temp in myColl)
            {
                Appointment app = (Appointment)temp.Item;
                Int32 Tn = app.RequiredAttendees.Count-1;
                Console.WriteLine(app.Subject + " " +Tn);
            }

我还想了解有多少必需的与会者已接受 session 邀请。

亲切的问候 克里斯托斯

最佳答案

您应该能够获得如下响应类型:

Appointment app;

int count = app.RequiredAttendees.Count(x => (x.ResponseType.HasValue && x.ResponseType.Value == MeetingResponseType.Accept));

关于c# - 计算已接受 EWS session 的与会者人数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21132680/

相关文章:

c# - 将 SQL Server 存储过程的值输出到变量中

php - 如何通过 PHP 检查我的脚本是否连接到 SMTP 服务器

powershell - 使用 EWS PowerShell 获取共享交换日历

java - 用于获取 session 室详细信息的 Outlook API,无论房间是否已预订

c# - 这个事件处理代码会导致内存泄漏吗?

c# - 修改 List<T> 对象以使用接收 <T> 的方法,反之亦然

c# - 无法将多个项目的目标框架从 v4.0 更改为 V4.5 或 4.5.1

java - com.sun.mail.util.MailConnectException : Couldn't connect to host, 端口 : localhost, 25;超时-1;

.net - Exchange 2003-使用哪个API找出房间/资源的可用性?

c# - 使用 Exchange Web Service 2010 查找所有未读电子邮件然后标记为已读?