This documentation is archived and is not being maintained.

IUccPresentity Interface

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Encapsulates a publisher of category instances.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

'Declaration
Public Interface IUccPresentity
	Inherits IUnknown
public interface IUccPresentity extends IUnknown
public interface IUccPresentity extends IUnknown

This interface includes properties for discovering the categories published by a user as well as information about the user. From the user related properties, a client can discover the following properties:

  • Is the publishing user the local user?

  • The source network of the publishing user.

  • The Uri-related properties of the publishing user.

  • The application context associated with the publishing user.

  • The categories published by the user.

An instance of IUccPresentity can be obtained from an instance of IUccSubscription by calling into CreatePresentity. A client can also obtain a reference to the interface from a Presentity property exposed by IUccCategoryInstance, IUccCategoryContext, _IUccPresentityEvents, and IUccSubscriptionEvent.

To receive this user's published presence category information, a client application must advise for:

The presentity event handler for OnCategoryContextAdded is the best place to advise for _IUccCategoryContextEvents events. Each time the client receives OnCategoryInstanceAdded, the event handler must advise for _IUccCategoryInstanceEvents for the new category instance.

An instance of IUccCategoryInstance received in a OnCategoryInstanceValueModified event provides the actual presence data published by the presentity whose events initiated the chain of presence information-related events.

Win32 COM/C++ Syntax

interface IUccPresentity : IUnknown

The following example accepts an instance of IUccSubscription and a UccUri instance representing the local user. The subscription instance is utilized as a factory object for a new presentity representing the local user. Note that the example immediately advises for _IUccPresentityEvents, specifying the class private field this.selfPresentity as the event source and the class itself as the presentity event sink.

private void StartPresentityEventsChain(UccUri localUser)
{ 
   //IUccPresentity  this.selfPresentity is class scoped private field 
   this.selfPresentity = CreateSelfPresentity(
      this.selfSubscription, 
      localUser);

   UCC_Advise<_IUccPresentityEvents>(
      this.selfPresentity,
      this);
}
private UccPresentity CreateSelfPresentity(IUccSubscription selfSubscription, UccUri localUser)
{
   UccPresentity returnValue = null;
   if (selfSubscription == null || localUser == null)
   {
      throw new ArgumentNullException();
   }
   returnValue = selfSubscription.CreatePresentity(localUser, null);
   return returnValue;
}

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Show: