我正在尝试在 UI 抑制模式下使用 Lync 2013 sdk 创建一个消息应用程序,我使用以下代码向对话中的所有参与者发送消息,但我找不到将消息发送到特定的方法其中之一,有人知道如何做到这一点吗?
我的代码:
public void StartIMConversation(string participantUri)
{
_Conversation.PropertyChanged += _Conversation_PropertyChanged;
_Conversation = _LyncClient.ConversationManager.AddConversation();
}
void ConversationsManager_ConversationAdded(Object source, ConversationManagerEventArgs data)
{
data.Conversation.ParticipantAdded += Conversation_ParticipantAdded;
data.Conversation.StateChanged += Conversation_StateChanged;
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri));
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri2));
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri3));
InstantMessageModality imModality = (InstantMessageModality)participant.Conversation.Modalities[ModalityTypes.InstantMessage];
imModality.BeginSendMessage(message, SendMessageCallback, imModality);
}
private void SendMessageCallback(IAsyncResult ar)
{
InstantMessageModality imModality = (InstantMessageModality)ar.AsyncState;
try
{
imModality.EndSendMessage(ar);
}
catch (LyncClientException lce)
{
MessageBox.Show("Lync Client Exception on EndSendMessage " + lce.Message);
}
}
如果使用对话无法完成此操作,请指导我找到正确的方法,如有帮助,我们将不胜感激。
最佳答案
无法在给定对话中选择 IM 的收件人。您最好的选择可能是只与您需要的参与者开始单独的对话。
关于c# - 在 UI 抑制模式下向对话 Lync 2013 SDK 中的特定用户发送 IM 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22229554/