简体   繁体   English

如何在lync cwe托管的xbap中获得当前对话?

[英]How to get current conversation in xbap hosted by lync cwe?

I am implementing an extension of Lync conversation window(Lync cwe). 我正在实现Lync对话窗口(Lync cwe)的扩展。 Lync has an embedded browser, so I use xbap(WPF browser application) to display some information for this conversation. Lync具有嵌入式浏览器,因此我使用xbap(WPF浏览器应用程序)显示此对话的一些信息。 But I can't get the current conversation object in xbap code. 但是我无法在xbap代码中获取当前的对话对象。 Information about Lync CWE: http://msdn.microsoft.com/en-us/library/office/hh378589(v=office.14).aspx 有关Lync CWE的信息: http : //msdn.microsoft.com/zh-cn/library/office/hh378589( v=office.14) .aspx

I know that it is easy to achieve this in silverlight application by calling LyncClient.GetHostingConversation(). 我知道通过调用LyncClient.GetHostingConversation()在Silverlight应用程序中很容易实现这一点。 But for some reasons, I can't choose silverlight. 但是由于某些原因,我无法选择Silverlight。

I found that Lync writes a key for every conversation in the browser. 我发现Lync为浏览器中的每个对话都编写了一个密钥。 We can use javascript code to access the property: "external.Parameters". 我们可以使用javascript代码访问属性:“ external.Parameters”。 I also observe the method GetHostingConversation(), it uses HtmlPage.Window.Eval("external.Parameters") to get a key used to get the current conversation. 我还观察了方法GetHostingConversation(),它使用HtmlPage.Window.Eval(“ external.Parameters”)获取用于获取当前对话的键。 But I don't know whether I can make use of this feature to get what I want in xbap. 但是我不知道我是否可以利用此功能在xbap中获得想要的东西。

I also tried to host an silverlight application in xbap. 我还尝试在xbap中托管silverlight应用程序。 I hope that if I write the right information to the web browser control of xbap, then the silverlight application hosted in xbap can also get the current conversation object for me. 我希望如果将正确的信息写入xbap的Web浏览器控件,那么xbap中托管的silverlight应用程序也可以为我获取当前的对话对象。 But I failed to add external.Parameters. 但是我无法添加external.Parameters。 Information about hosting silverlight in xbap: http://msdn.microsoft.com/en-us/library/cc656722.aspx 有关在xbap中托管Silverlight的信息: http : //msdn.microsoft.com/zh-cn/library/cc656722.aspx

Here is the steps I have made: 这是我已执行的步骤:

  1. Create a WPF browser application 创建一个WPF浏览器应用程序
  2. Add reference of Microsoft.Lync.Model and Microsoft.Lync.Utilities 添加对Microsoft.Lync.Model和Microsoft.Lync.Utilities的引用
  3. Use the following code to get the current conversation object: 使用以下代码获取当前对话对象:
    Conversation currentConversation = (Conversation)LyncClient.GetHostingConversation();

But visual studio told me LyncClient does not have a definition for GetHostingConversation. 但是Visual Studio告诉我LyncClient没有GetHostingConversation的定义。

So is it possible to get the current conversation object in xbap? 那么有可能在xbap中获取当前的对话对象吗? And how? 如何?

Thanks. 谢谢。

The GetHostingConversation method is only available in Lync Silverlight applications. GetHostingConversation方法仅在Lync Silverlight应用程序中可用。 It looks like you're using WPF. 看来您正在使用WPF。 If WPF is required, you need to find out how to get the conversation object in a Lync WPF app. 如果需要WPF,则需要了解如何在Lync WPF应用程序中获取对话对象。 My memory is it's a bit more work than in a Silverlight application. 我的记忆是,与Silverlight应用程序相比,它需要做更多的工作。 You might consider posting a question on the Lync SDK forum, here: 您可以考虑在Lync SDK论坛上发布问题,这里:

http://social.msdn.microsoft.com/Forums/lync/en-US/home?forum=communicatorsdk http://social.msdn.microsoft.com/Forums/lync/zh-CN/home?forum=communicatorsdk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM