单击按钮,应为活动对话窗口触发桌面共享事件。在按钮单击中,我们有以下代码:
private void StartSharingResource_Button_Click(object sender, EventArgs e)
{
//If there is no active conversation to share this resource in, return from handler
if (_conversation == null)
{
return;
}
//If there is no sharing modality stored locally on the active conversation, get it from the active conversation and store it.
if (_sharingModality == null)
{
_sharingModality = _conversation.Modalities[ModalityTypes.ApplicationSharing] as ApplicationSharingModality;
}
}
On Conversation添加甚至我们正在获取对话模式
void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)
{
_sharingModality = (ApplicationSharingModality)_conversation.Modalities[ModalityTypes.ApplicationSharing];
}
在_conversation.Modalities [ModalityTypes.ApplicationSharing]部分中都是null,我们得到一个对象引用错误。我们正在使用LYNC SDK - 15.0.4603.1000版本。