Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 通过浏览器外的Silverlight调用Office Communicator_C# 4.0_Silverlight 4.0_Silverlight Oob_Office Communicator - Fatal编程技术网

C# 4.0 通过浏览器外的Silverlight调用Office Communicator

C# 4.0 通过浏览器外的Silverlight调用Office Communicator,c#-4.0,silverlight-4.0,silverlight-oob,office-communicator,C# 4.0,Silverlight 4.0,Silverlight Oob,Office Communicator,我需要调用office communicator来创建聊天窗口,并在浏览器用完时直接从Silverlight拨打电话。在浏览器中运行时,我会这样做,而且效果非常好: System.Windows.Browser.HtmlPage.Window.Eval(String.Format("window.open(\"sip:{0}\", target=\"_self\");", sip)); 当浏览器用完时,我所能做的就是通过动态调用Communicator.UIAutomation,但老实说,我不

我需要调用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");
有人对如何实现这一目标有什么建议吗?搜索结果为零。

一些想法:

您是否尝试过将automated Communicator对象设置为var,然后设置断点并深入到生成的对象中?您可能会在对象上找到一些方法或属性,您可以使用这些方法或属性使事情发生

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

一些想法:

您是否尝试过将automated Communicator对象设置为var,然后设置断点并深入到生成的对象中?您可能会在对象上找到一些方法或属性,您可以使用这些方法或属性使事情发生


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

SDK必须预先安装在用户计算机中。在Silvelright OOB应用程序中部署它并不容易

你将需要一份工作

您可以在此处查看文档以了解更多详细信息:C:\Program Files x86\Microsoft Office Communicator\SDK\OCSDK.chm 它主要指的是C语言,但大部分可以很容易地移植到Com自动化。作为示例,请查看以下代码以开始对话

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程序集

SDK必须预先安装在用户计算机中。在Silvelright OOB应用程序中部署它并不容易

你将需要一份工作

您可以在此处查看文档以了解更多详细信息:C:\Program Files x86\Microsoft Office Communicator\SDK\OCSDK.chm 它主要指的是C语言,但大部分可以很容易地移植到Com自动化。作为示例,请查看以下代码以开始对话

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程序集

我尝试了var技巧,但它将其设置为一个自动化,基本上恢复为动态。我尝试了var技巧,但它将其设置为一个自动化,基本上恢复为动态。