_IUccContainerEvents Interface
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
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)
{
}
}