IUccCategoryContextEvent.CategoryContext 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 category context returned as part of the events.

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

Syntax

'Declaration
ReadOnly Property CategoryContext As IUccCategoryContext
IUccCategoryContext CategoryContext { get; }
property IUccCategoryContext^ CategoryContext {
    IUccCategoryContext^ get ();
}
/** @property */
IUccCategoryContext get_CategoryContext ()
function get CategoryContext () : IUccCategoryContext

Property Value

A value of the IUccCategoryContext** (IUccCategoryContext, for a .NET application) type.

Remarks

A client must advise for a hierarchical series of events starting with _IUccPresentityEvents and continuing through _IUccCategoryInstanceEvents events in order to receive updates to a remote user's published category information. The IUccCategoryContextEvent property CategoryContext holds an essential link in this chain of events. When a presentity has published a category context, the local client receives the OnCategoryContextAdded event and must advise for the category context contained within the CategoryContext property.

Note

The Name property of the category context can be used when a client is to advise for specifc category context by name.

The CategoryContext property is also returned as part of the IUccCategoryContextEvent event data argument of the OnCategoryContextRemoved event. A client should use the value of this property to un-advise for the category instances and category context that were advised for when the category context was added by the presentity.

Win32 COM/C++ Syntax

HRESULT get_CategoryContext
(
   IUccCategoryContext** ppVal
);

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 uses the CategoryContext property available to a local client as part of the OnCategoryContextAdded event. The Name property is examined to direct the handler logic to advise for the category context events using the CategoryContext property as event source.

void _IUccPresentityEvents.OnCategoryContextAdded(
    UccPresentity pEventSource,
    UccCategoryContextEvent pCategoryCtxt)
{
    String contextName = pCategoryCtxt.CategoryContext.Name.ToLower();
    if (contextName == "contactcard" ||
      contextName == "state" ||
      contextName == "note" ||
      contextName == "freebusy")
    {
        //Advise for category context events to get notified when
        //corresponding instances are published
        UCC_Advise<_IUccCategoryContextEvents>(
            pCategoryCtxt.CategoryContext, 
        this);
    }
}

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

IUccCategoryContextEvent Interface
IUccCategoryContextEvent Members
Microsoft.Office.Interop.UccApi Namespace