_IUccCategoryContextEvents 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.

Defines the events raised by an IUccCategoryContext instance.

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

Syntax

'Declaration
Public Interface _IUccCategoryContextEvents
    Inherits IDispatch, IUnknown
public interface _IUccCategoryContextEvents : IDispatch, IUnknown
public interface class _IUccCategoryContextEvents : IDispatch, IUnknown
public interface _IUccCategoryContextEvents extends IDispatch, IUnknown
public interface _IUccCategoryContextEvents extends IDispatch, IUnknown

Remarks

An application must implement this interface and advise an IUccCategoryContext object of the implementation to get notified of the events that a category instance is added to or removed from a particular category context by a particular publisher. This is a dispinterface. Its members define the event handlers for the events raised by an IUccCategoryContext object. To catch the events, a UCC API client must implement these event handlers and advise the event source of the implementation if it is interested in receiving the events. To prevent memory leaks, the client should unadvise the events when it is no longer interested in the events.

Win32 COM/C++ Syntax

dispinterface _IUccCategoryContextEvents

Example

The following example is an application class designed to handle presentity events. Note that the class advises a category context instance of an event sink when the context instance is received.

/// <summary>
/// advise for added category context when new context is
/// contactCard, state, note, or freeBusy
/// </summary>
/// <param name="pEventSource">object that raised the event</param>
/// <param name="pCategoryCtxt">event specific data</param>
void _IUccPresentityEvents.OnCategoryContextAdded(
    UccPresentity pEventSource,
    UccCategoryContextEvent pCategoryCtxt)
{
    IUccCollection publishedCategories = pEventSource.CategoryContexts;
    IUccContext c = pCategoryCtxt.Context;

    String contextName = pCategoryCtxt.CategoryContext.Name.ToLower().Trim();
    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);
    }
}

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

_IUccCategoryContextEvents Members
Microsoft.Office.Interop.UccApi Namespace

Other Resources

Code Listing: Basic Event Registration and Other Helper Methods in C#