Export (0) Print
Expand All

_IUccContainerEvents 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 events raised by an IUccContainer instance.

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

public interface _IUccContainerEvents : IDispatch, IUnknown
public interface _IUccContainerEvents extends IDispatch, IUnknown
public interface _IUccContainerEvents extends IDispatch, IUnknown

Container events are raised when container members are added or removed from a given container. An application must implement this interface and advise an IUccContainer object of the implementation to receive notifications showing a container member is added to or removed from a container. This is a dispinterface. Its members define the event handlers for the events raised by an IUccContainer 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 _IUccContainerEvents

The following example advises for container events. A client application must first advise for presentity events. The presentity event OnCategoryContextAdded provides an application with instances of category context. Each category context instance received is advised of the presence of a context event handler.

The example handles one of these category context events to advise for category instance and container events on received category instance when that instance is of the context "containers".

void _IUccCategoryContextEvents.OnCategoryInstanceAdded(
    IUccCategoryContext pCategoryCtx, 
    UccCategoryInstanceEvent pCategory)
{
    IUccCategoryInstance ci = pCategory.CategoryInstance;
    switch (pCategoryCtx.Name.ToLower())
    {
        case "contacts":
            break;
        case "containers":
            //advise for category instance events
            UCC_Advise<_IUccCategoryInstanceEvents>(
                pCategory.CategoryInstance,
                this);
            //advise for container events on this category instance
            UCC_Advise<_IUccContainerEvents>(
                pCategory.CategoryInstance as IUccContainer, 
                this);
                
            break;
    }
}

The following example application class implements the _IUccContainerEvents interface and provides the event callbacks necessary to handle container events.

public class Container : _IUccContainerEvents
{
    void _IUccContainerEvents.OnMemberAdded(
        IUccContainer pContainer, 
        UccContainerMemberCollectionEvent pEventData)
    {
    }
    void _IUccContainerEvents.OnMemberRemoved(
        IUccContainer pContainer, 
        UccContainerMemberCollectionEvent pEventData)
    {
    }
}

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:
© 2014 Microsoft