I use lync 2010 sdk and develop with lync wpf application. I can send message to a group or a person but can't catch the received message text.
like the code ı can catch when a new conversation added, but can't read message text too.
Does anyone know how can ı do it?
private Conversation _conversation;
LyncClient _LyncClient;
void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)
{
if (_conversation == null)
{
_conversation = e.Conversation;
}
string getmessage=_conversation.GetApplicationData(_AppId);
_conversation.ParticipantAdded += _conversation_ParticipantAdded;
if (_conversation.Modalities[ModalityTypes.InstantMessage].State != ModalityState.Notified)
{
_RemoteContact = _LyncClient.ContactManager.GetContactByUri("sip:xxx @xxx.com.tr");
_conversation.AddParticipant(_RemoteContact);
}
e.Conversation.InitialContextReceived += Conversation_InitialContextReceived;
e.Conversation.ContextDataReceived += Conversation_ContextDataReceived;
e.Conversation.StateChanged += Conversation_StateChanged;
((InstantMessageModality)e.Conversation.Modalities[ModalityTypes.InstantMessage]).InstantMessageReceived += MainWindow_InstantMessageReceived;
}