MSDN Library

IContact Interface

Represents a Lync user.

Namespace:  UCCollaborationLib
Assembly:  Microsoft.Office.Uc (in Microsoft.Office.Uc.dll)

interface IContact : IDispatch

Presence, available modalities, group membership, and contact type properties for a user are exposed by IContact. To start a conversation with another user, you must provide that user's instance of IContact to the conversation factory. The interface identifier (IID) of this interface is 85109845-6ae2-4b6b-9524-65ba203e5b7d.

The capability of a Lync user to participate in conversations using a combination of the available modalities can change over time. For example, a user may connect or disconnect a webcam at any time. Any change in the connection state of the webcam results in a change in the user's capability to engage in a conversation using audio or video. These capabilities are exposed through the IContact inteface.  To get the current capabilities of a contact, do the following steps:
  1. Call IContact.GetContactInformation. In the argument, pass ContactInformationType.ucPresenceCapabilityDetails.
  2. Iterate on the returned collection of IPresenceCapability and read the Type property to get the type of each presence capability item.
  3. Read the CanRender property of the presence capability. If true, then the user can display incoming content of the given capability type.
  4. Read the CanCapture property of the presence capability. If true, then the user can send outgoing content of the given capability type.
  5. Read the Availability property of the presence capability. The return value is the availability state of the endpoint of the user that published the capability.

After you obtain the capabilities of a contact at a certain point, you should advise for the OnContactInformationChanged event. This event is raised whenever information is published on behalf of a user. This information includes the new state of the user's capabilities.

To get these events and maintain a view of the current state of a contact capabilities, do the following steps:
  1. Advise for OnContactInformationChanged on each IContact instance you are interested in.
  2. Handle the OnContactInformationChanged event.
  3. Read the ChangedContactInformation property to get a collection of the ContactInformationType values for the contact information types that have changed.
  4. Find ContactInformationType.ucPresenceCapabilityDetails in the collection. If present, then the contact capabilites have changed.
  5. Call IContact.GetContactInformation and pass ContactInformationType.ucPresenceCapabilityDetails. The current capabilities of the contact are returned.

Community Additions

© 2016 Microsoft