Lync ConversationRemoved 获取当前对话文本 [英] Lync ConversationRemoved get current conversation text

查看:45
本文介绍了Lync ConversationRemoved 获取当前对话文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Lync SDK,我正在寻找是否有人知道如何获取正在关闭的对话的对话文本.

我正在举办这个活动.

static void _conversationManager_ConversationRemoved(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)

而且我无法从这个只有参与者那里获得任何对话文本.

解决方案

如果您订阅了 ConversationManager 的 ConversationAdded 事件,那么您可以在每个新对话开始时收到通知.然后,您可以在该对话中订阅 InstantMessageModality 的 InstantMessageReceived 事件(假设您要捕获即时消息对话的对话文本).

然后你应该把它存储在某个地方.例如,您可以拥有一个包含对话 ID、时间戳和消息的列表.我希望您希望获得格式良好的输出,例如:

<预>用户 1 (10:01) 一些文字用户 2 (10:02) 还有一些文字

我认为你必须自己制作这个,但这应该很容易.只要您存储(对于收到的每条消息)时间戳、发送它的用户、与之相关的对话 ID 以及文本,您就可以在以后建立所有这些.

在您的 ConversationRemoved 事件中,您可以从列表中提取所有数据,对其进行格式化,并对其进行任何您想做的事情.

希望有所帮助.

-汤姆

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.

解决方案

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

这篇关于Lync ConversationRemoved 获取当前对话文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆