我做了一个小应用程序,当我的一个联系人的可用性发生变化时,我可以得到更新。目前我只记录这个。
我在这里找到了一个很好的资源:https ://rcosic.wordpress.com/2011/11/17/availability-presence-in-lync-client/
基本上建议如下:
//Register to a contact
Contact contactByUri = _lyncClient.ContactManager.GetContactByUri(user.UserUri);
contactByUri.ContactInformationChanged += new EventHandler(Self_ContactInformationChanged);
void Self_ContactInformationChanged(object sender, ContactInformationChangedEventArgs e)
{
Contact self = sender as Contact;
// has user changed his availability (therefore, his presence status)?
if (e.ChangedContactInformation.Contains(ContactInformationType.Availability))
{
ContactAvailability availability = (ContactAvailability)self.GetContactInformation(ContactInformationType.Availability);
string activity = (string)self.GetContactInformation(ContactInformationType.Activity);
OnAvailabilityChanged(availability, activity);
}
}
可用性为以下之一:
Invalid (-1),
None (0) – Do not use this enumerator. This flag indicates that the cotact state is unspecified.,
Free (3500) – A flag indicating that the contact is available,
FreeIdle (5000) – Contact is free but inactive,
Busy (6500) – A flag indicating that the contact is busy and inactive,
BusyIdle (7500) – Contact is busy but inactive,
DoNotDisturb (9500) – A flag indicating that the contact does not want to be disturbed,
TemporarilyAway (12500) – A flag indicating that the contact is temporarily away,
Away (15500) – A flag indicating that the contact is away,
Offline (18500) – A flag indicating that the contact is signed out.
大多数情况下,一切正常,但有些日子,我收到ContactAvailability
= None
。
我想知道为什么,如果我能做些什么来解决这个问题?(比如重置客户端 sdk,...)?