【发布时间】:2012-06-21 11:52:11
【问题描述】:
我正在尝试为 Lync 2010 UCMA 创建一个简单的联系人管理器。
我正在使用NotificationReceived 事件,并测试是否设置了IsFullNotification 标志。我希望随着组的添加,不会有“IsFullNotification”。
但是这样的事件永远不会发生,它总是设置为true。
在添加新创建的数量之前,我怎样才能获得已添加组的完整联系人列表(因为它们已成功添加)以重新映射联系人。
附:使用 translate.google.com 翻译
_contactGroupServices.NotificationReceived += OnNotificationReceived;
_contactGroupServices.BeginSubscribe(ar =>
{
try
{
_contactGroupServices.EndSubscribe(ar);
}
catch (RealTimeException rtex)
{
Console.WriteLine(rtex);
}
}
, null);
处理程序:
void OnNotificationReceived(object sender, ContactGroupNotificationEventArgs e)
{
Console.WriteLine("Received a contact update.");
if (e.IsFullNotification) //always this value :(
{
ExtractContactGroupInfo(e);
AddGroups();
}
else
{
HandleAddedGroupNotification(e); // The LINE
}
}
我已经标记了添加所有组时需要执行的行。而且我还需要ContactGroupNotificationEventArgs e的当前值。
【问题讨论】:
-
我什至尝试在添加 fll 组后调用 BeginSubscribe,但出现错误:“数据会话处于无效状态以建立”。
-
我已经尝试更正一下翻译,请检查它是否“听起来不错”。如果我理解错了,我可能会不小心改变了一些东西。另外,我无法理解最后一句“我怎么还能得到(..)”的意思,所以我原样留下。您可以尝试以两种语言发布文本,一种是翻译的,一种是原文的 - 这样,有人可以准确地修复翻译错误:) BTW。如果“Roman”是波兰人的名字,我下次可以帮忙:)