【发布时间】:2016-01-06 00:21:25
【问题描述】:
我正在使用 UCMA 4.0 来获取用户的在线状态。我已经定义了一个这样的事件处理程序
_remotePresenceView.PresenceNotificationReceived += new EventHandler<
RemotePresentitiesNotificationEventArgs>(RemotePresence_PresenceNotificationReceived);
其实现如下:
// Event handler to process remote target's presence notifications
private void RemotePresence_PresenceNotificationReceived(object sender,
RemotePresentitiesNotificationEventArgs e)
{
Console.WriteLine(String.Format("Presence notifications received for target {0}", <<How do I get the username here>>
));
// Notifications contain all the notifications for one user.
foreach (RemotePresentityNotification notification in e.Notifications)
{
if (notification.AggregatedPresenceState != null)
{
Console.WriteLine("Aggregate State = "
+ notification.AggregatedPresenceState.Availability);
}
}
Console.WriteLine("Press ENTER to delete the contact, delete the group, and unsubscribe to the "
+ "presence of the remote user.");
}
我的问题是如何在事件处理程序代码中获取人员通知已更改的用户名?
【问题讨论】: