IUccCategoryInstance.Presentity Property
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.
Gets the publisher of this category instance.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Syntax
'Declaration
ReadOnly Property Presentity As UccPresentity
UccPresentity Presentity { get; }
property UccPresentity^ Presentity {
UccPresentity^ get ();
}
/** @property */
UccPresentity get_Presentity ()
function get Presentity () : UccPresentity
Property Value
A value of the IUccPresentity** (IUccPresentity, for a .NET application) type.
Remarks
If a single client application class instance handles category instances for multiple publishing presentities, the Presentity property is useful to determine which presentity published a given category instance. Another scenario where the Presentity property is useful is the situation where a client application places all received category instances in a single global cache. In this case, the Presentity property establishes the publishing presentity of the category instance.
Win32 COM/C++ Syntax
HRESULT get_Presentity
(
IUccPresentity** ppPresentity
);
Note
In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.
Example
The following example is an event handler implemented in a class designated as the event sink for category instance events across publishing presentities. For this reason, the handler must determine the publishing presentity before processing the event. The handler will display the display name of all received contact card category instances except those that were published by the local user.
void _IUccCategoryInstanceEvents.OnCategoryInstanceValueModified(
IUccCategoryInstance pEventSource, object pEventData)
{
//process the updated "contactCard" category instance
if (pEventSource.Presentity.IsSelf == false)
{
if (pEventSource.CategoryContext.Name == "contactCard")
{
IUccPresenceContactCardInstance card = pEventSource as IUccPresenceContactCardInstance;
IUccPresenceContactCardIdentity cardID = card.Identity as IUccPresenceContactCardIdentity;
if (cardID != null)
{
Console.WriteLine("Contact: " + cardID.DisplayName);
}
}
}
}
Thread Safety
All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.
Platforms
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
See Also
Reference
IUccCategoryInstance Interface
IUccCategoryInstance Members
Microsoft.Office.Interop.UccApi Namespace