本文介绍了Lync Client 2013不提供“拖放”数据。将联系人从联系人列表拖动到WinForms应用程序时的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hello亲爱的Lync团队,

Hello dear Lync team,



我们的.NET 2.0 WinForms应用程序正在Lync集成模式下工作。我们的UI包括将Lync联系人从联系人拖动到特殊窗格,然后操纵该Lync联系人数据。

Our .NET 2.0 WinForms application is working in Lync-integrated mode. Our UI includes dragging Lync contact from contact to special pane and then manipulating that Lync contact data.



我们的应用程序使用从Lync的联系人列表拖动联系人的功能,然后在我们的应用程序表单上删除,然后它使用来自掉线(啜饮地址)。这对Lync 2010客户端运行良好,但是对于Lync 2013客户端,它不再工作了,因为
我们发现Lync 2013不再提供拖动联系人的SIP地址。 

Our app uses feature of dragging contact from contact list of Lync, then dropping on our app form, and then it uses data from dropped contact (sip address). This was working well with Lync 2010 client, but with Lync 2013 client it is not working anymore, because we found that sip address for dragged contact is not provided anymore by Lync 2013. 


因此,当DragEnter事件发生时,我们在DragEnter事件处理程序中的代码正在检查DragEventArgs.Data属性,如果正确的话找到格式,提取联系人数据以供进一步使用:

So when DragEnter event occurs, our code in DragEnter event handler is checking DragEventArgs.Data property and if proper format is found, extracts contact data for further usage:

        private void PanelLyncContact_DragDrop(object sender, DragEventArgs e)
        {
            string sipAddressParsed = ParseDragDropInfo(e.Data);

            if (sipAddressParsed != null)
                ProcessData(sipAddressParsed);
        }

        private static string ParseDragDropInfo(IDataObject data)
        {
            foreach (string format in data.GetFormats())
            {
                if (format == DataFormats.StringFormat ||
                    format == DataFormats.UnicodeText ||
                    format == DataFormats.Text)
                {
                    return data.GetData(format).ToString();
                }
            }
            return null;
        }



但是当我们在Lync 2013集成模式,data.GetFormats()返回空数组,没有任何格式正在工作。这很奇怪,因为当我们将Lync联系人复制到剪贴板并尝试从剪贴板获取相同的数据时,我们会按预期获得sip
地址: 

But when we use our application in Lync 2013-integrated mode, data.GetFormats() returns empty array and none of formats are working. This is strange, because when we copy Lync contact to clipboard and try to get same data from clipboard, we are getting sip address as expected: 

// copy Lync'2013 contact in Contact List before running code below

Console.Writeline(Clipboard.GetData(DataFormats.Text));



所以我假设必须为Drag& Drop提供Lync联系人数据,但由于某些原因,它无法正常工作。或者,此功能从Lync 2013客户端版本开始停止。

So I'm assuming that Lync contact data must be provided for Drag&Drop, but for some reasons it is not working. Or, this feature was discontinued starting from Lync 2013 client version.



所以问题是:

So, the question is:


拖动时联系从Lync 2013客户端到另一个应用程序,


是否在故意拖拽事件中没有数据?这种行为是设计的,还是一个错误?

Is that absense of data in drag'n'drop event intentional? Is that behavior by design, or is it a bug?



如果这种行为是错误的,你将来会修复它吗?或者你会为我们的案例提出任何解决方法吗?

If that behavior is wrong, will you fix it in future? Or would you propose any workarounds for our case?



提前致谢,

Thanks in advance,



Max

Max


圣彼得堡

推荐答案

复制(右键单击复制)并将地址粘贴到剪贴板/从剪贴板粘贴似乎正常工作。

Copying (right-click copy) and pasting the address to/from the clipboard seems to work properly.

我创建了另一个带有Lync联系人列表的WPF应用程序,并且能够成功拖放到Outlook 2013和我的应用程序。所以我知道联系人列表功能仍然可以理论上工作。 

I have created another WPF application with a Lync Contact list and was able to successfully drag/drop to Outlook 2013 and my application.  So I know the contact list functionality can still work in theory. 

这可能是Lync 2013中的一个错误客户?

Is it possible this is a bug in the Lync 2013 client?

谢谢,

Ted


这篇关于Lync Client 2013不提供“拖放”数据。将联系人从联系人列表拖动到WinForms应用程序时的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 06:43