在浏览器外通过 Silverlight 调用 Office Communicator

发布于 2024-09-15 07:28:41 字数 445 浏览 15 评论 0原文

当浏览器耗尽时,我需要调用 Office Communicator 创建聊天窗口并直接从 Silverlight 拨打电话。当在浏览器中运行时,我这样做并且效果很好:

System.Windows.Browser.HtmlPage.Window.Eval(String.Format("window.open(\"sip:{0}\", target=\"_self\");", sip));

当运行浏览器时,据我所知,是通过动态调用 Communicator.UIAutomation,但老实说,我不知道下一步该做什么。

dynamic communicator = AutomationFactory.CreateObject("Communicator.UIAutomation");

有人对如何进行这项工作有任何建议吗?搜索结果为零。

I need to invoke office communicator to create a chat window and phone call directly from Silverlight when running out of browser. When running in browser I do this and it works pretty well:

System.Windows.Browser.HtmlPage.Window.Eval(String.Format("window.open(\"sip:{0}\", target=\"_self\");", sip));

When running out of browser as far as I have gotten is to invoke the Communicator.UIAutomation via a dynamic but honestly I don't know what to do next.

dynamic communicator = AutomationFactory.CreateObject("Communicator.UIAutomation");

Anyone have any suggestions on how to make this work? Searching has yeilded zero results.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遗失的美好 2024-09-22 07:28:41

一些想法:

您是否尝试过将自动 Communicator 对象设为 var,然后设置断点并深入研究生成的水合对象?您可能会在对象上找到一些可用于实现某些操作的方法或属性。

有一个博客 此处 描述了 Office Communicator SDK 并包含一些示例项目。我认为您可以将 SDK 程序集包含在 OOB 应用程序中,并使用 Microsoft 提供的 SDK 自动化 Communicator。

A couple thoughts:

Have you tried making the automated Communicator object a var, then setting a breakpoint and digging into the resulting hydrated object? You might find some methods or properties on the object you can use to make things happen.

There's a blog here that describes the Office Communicator SDK and has some sample projects. I think you might be able to include the SDK assemblies in your OOB app and automate Communicator using Microsoft's provided SDK.

请恋爱 2024-09-22 07:28:41

SDK 必须预先安装在用户计算机中。没有简单的方法可以将其与 Silverright OOB 应用程序一起部署。

您将需要 SDK

您可以在此处查看文档以获取更多详细信息:C:\Program Files (x86)\Microsoft Office Communicator\SDK\OCSDK.chm
它主要参考C#,但其中大部分可以轻松移植到Com Automation。作为示例,请查看以下代码来开始对话,

dynamic comm = new ActiveXObject("Communicator.UIAutomation");
dynamic msgrAdv = comm.IMessengerAdvanced;
if(msgrAdv!=null)
{
    try
    {
        object obj = msgrAdv.StartConversation(
                   1, //CONVERSATION_TYPE.CONVERSATION_TYPE_IM,
                   sipUris, // object array of signin names
                   null,
                   "Testing",
                   "1",
                   null);
        windowHandle = long.Parse(obj.ToString());
    }
    catch (COMException ex)
    {
        this.writeToTextBox(
                formReturnErrors.returnComError(ex.ErrorCode)
    );

}

我希望这会有所帮助。请注意,从帮助文件中的示例中,我更改了 .NET 程序集中定义的一些成员(无法从 C# 代码中引用)。如果您需要这个,我建议在 Reflector 中打开 CommunicatorAPI.dll 程序集。

The SDK has to be preinstalled in the user machines. There's no easy way to deploy it along your Silvelright OOB application.

You will need the SDK.

You can check the documentation for more details here: C:\Program Files (x86)\Microsoft Office Communicator\SDK\OCSDK.chm
It mainly refers to C#, but most of it could easily be ported to Com Automation. As an example look at the following code to start a conversation

dynamic comm = new ActiveXObject("Communicator.UIAutomation");
dynamic msgrAdv = comm.IMessengerAdvanced;
if(msgrAdv!=null)
{
    try
    {
        object obj = msgrAdv.StartConversation(
                   1, //CONVERSATION_TYPE.CONVERSATION_TYPE_IM,
                   sipUris, // object array of signin names
                   null,
                   "Testing",
                   "1",
                   null);
        windowHandle = long.Parse(obj.ToString());
    }
    catch (COMException ex)
    {
        this.writeToTextBox(
                formReturnErrors.returnComError(ex.ErrorCode)
    );

}

I hope this help. Noticed that from the example in the help file I changed some of the members that are defined in the .NET Assembly (which can't be referenced from your C# code). If you need this, I would suggest opening the CommunicatorAPI.dll assembly in Reflector.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文