Chi*_*nti 5 c# office-communicator lync
我正在将IM Presence信息编码到我的公司silverlight应用程序中.到目前为止,我发现的唯一解决方案是CodePlex(Silverlight.OCS).这是"好的",但它已经过时了.
Lync SDK使得在Silverlight中获取Presence信息变得非常容易.遗憾的是,我们网络上99%的用户仍然使用OFfice Communicator(R2),因此使用开箱即用的Lync方法(控件:在xaml中的PresenceIndicator ...)是行不通的.
那么,我很好奇Lync SDK是否包含与Office Communicator通信的方式?
如果是这样,我将如何a)检查正在运行的客户端,然后b)连接到该客户端 - 无论是Lync还是Communicator.很感谢任何形式的帮助!最后但并非最不重要的 - 如果可能的话,我正在寻找C#代码.谢谢!
您不能对 Office Communicator 使用 Lync 2010 SDK,只能对 Lync 2010 使用。
SDK 的前身是 Office Communicator Automation API (OCAA)。它是基于 COM 的 API,适用于 Communication 2007 和 2007 R2。目前仍受支持!
至于获取状态信息……好吧,希望这可能对您有所帮助(免责声明,我还太年轻,无法完成任何 OCS API 工作;)
private IMessengerContact FindContact(string userID)
{
IMessengerContact contact = null;
// Try the local contact list first
try
{
contact = (IMessengerContact)communicator.GetContact(userID, "");
}
catch
{
contact = null;
}
// For a nonlocal contact, try the SIP Provider of Communicator
if (contact == null || contact.Status == MISTATUS.MISTATUS_UNKNOWN)
{
try
{
contact =
(IMessengerContact)communicator.GetContact(userID,
communicator.MyServiceId);
return contact;
}
catch
{
contact = null;
return contact;
}
}
else
{
return contact;
}
}
Run Code Online (Sandbox Code Playgroud)
返回联系人的状态:
IMessengerContact接口定义了一个Status属性,其中包含多个MISTATUS值之一。