0

我有将文件发送到客户端的代码,在另一端我使用 ContentAdded 事件接收它。该事件被引发,但 CanInvoke 返回错误。我哪里错了?

void _sharingModality_ContentAdded(object sender, ContentCollectionChangedEventArgs e)
    {
        if (e.Item.Type == ShareableContentType.NativeFile)
        {
            int hr;
            if (e.Item.CanInvoke(ShareableContentAction.DownloadFile, out hr))
            {
                MessageBox.Show("download event raised");
            }
            else
            {
                MessageBox.Show("u cannot invoke download");
            }
        }
    }

谢谢!

(注意:我使用的是 Lync 客户端 2013)

编辑1:

如果我在该语句之前放置一个消息框,CanInvoke 返回 true,否则返回 false。它会影响一些后台线程还是什么?

4

1 回答 1

1

得到了答案。那个状态ShareableContent是我们的文件,Connecting当我在它上面触发 CanInvoke 时。该文件只能在状态更改为 时下载Online。所以通过处理ShareableContent.StateChanged事件我让它工作。如此简单,但由于文档非常差,所以花了很多时间。

MSDN参考这里..

于 2014-04-29T16:40:18.070 回答