问题
I am using Lync SDK and I am looking if anyone knows how to get the Conversation Text of a conversation that is being closed.
I am running this event.
static void _conversationManager_ConversationRemoved(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)
And I cannot seam to get any conversation text from this only participants.
回答1:
If you subscribe to the ConversationAdded event of the ConversationManager then you can be notified when each new conversation starts. Within that conversation you can then subscribe to the InstantMessageReceived event of the InstantMessageModality (assuming you want to capture the conversation text of an instant message conversation).
You should then store this somewhere. For instance, you could have a List of conversation IDs, timestamps and messages. I expect you're hoping to get a nicely formatted output such as:
User 1 (10:01) Some text User 2 (10:02) Some more text
I think you're going to have to produce this yourself, but it should be quite easy. As long as you store (for each message received) the timestamp, the user sending it, the conversation ID to which it pertains, and the text, then you can build it all up later.
In your ConversationRemoved event you can then pull all that data out of the List, format it, and do whatever you want with it.
Hope that helps.
-tom
来源:https://stackoverflow.com/questions/10536331/lync-conversationremoved-get-current-conversation-text