簡體   English   中英

UCMA 4.0如何從PresenceNotificationReceiveved處理程序獲取用戶名

[英]UCMA 4.0 How to get user name from PresenceNotificationRecieved Handler

我正在使用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.");

}

我的問題是如何獲取事件處理程序代碼中持久性通知已更改的人的用戶名?

RemotePresentityNotification類上有一個ContactCard屬性,該屬性將提供包括DisplayName在內的各種詳細信息,因此在您的情況下,您將需要引用notification.ContactCard.DisplayName

您還可以通過使用通知的PresentityUri屬性為用戶交叉引用AD的“ msRTCSIP-PrimaryUserAddress”屬性來使用DirectorySearcher執行Active Directory查找。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM