Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

_IUccContainerEvents.OnMemberAdded Method

Raised when a container member is added to a container.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
void OnMemberAdded (
	IUccContainer pContainer,
	UccContainerMemberCollectionEvent pEventData
)
void OnMemberAdded (
	IUccContainer pContainer, 
	UccContainerMemberCollectionEvent pEventData
)
function OnMemberAdded (
	pContainer : IUccContainer, 
	pEventData : UccContainerMemberCollectionEvent
)

Parameters

pContainer

A value of the IUccContainer* (IUccContainer, for a .NET application) type. This represents the container to which the specified container member is added.

pEventData

A value of the IUccContainerMemberCollectionEvent* (UccContainerMemberCollectionEvent, for a .NET application) type. This contains the container member added to the specified container.

A container member is defined by the scope attributed to the member as stored in the Scope property of the member. The enumeration, UCC_CONTAINER_MEMBERSHIP_SCOPE defines the possible scope values. A container member with a broad scope such as UCCCMS_EVERYONE indicates the owning container also contains category data that all users have access to. Conversly, a container whose membership includes a member whose scope is UCCCMS_USER is a container whose category instances are available to the specified user.

A container may contain multiple container members with no restriction of scope. This means a container may have both a member with a broad scope and a member with a very limited scope. For example: A container can have a member whose scope is UCCCMS_COMPANY which means all members of the local user's company have access to the contained category instances. This container can have a member whose scope is UCCCMS_USER and whose specified Uri is that of a user outside of the local user's company.

Win32 COM/C++ Syntax

HRESULT OnMemberAdded
(
   IUccContainer* pContainer,
   IUccContainerMemberCollectionEvent* pEventData
);
Cc715656.note(en-us,office.12).gifNote:
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 .

The following example handles the OnMemberAdded event to maintain an application dictionary<string, ContainerMember> containing a collection of container member instances. The example examines the scope of the received IUccContainerMember to determine whether the Uri property of the instance is filled.

void _IUccContainerEvents.OnMemberAdded(
   IUccContainer pContainer, 
   UccContainerMemberCollectionEvent pEventData)
{
   IUccContainerMember cm = pEventData.ContainerMember;
   string dictionaryKey = string.Empty;
   if (cm.Scope == UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_USER || cm.Scope == UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_DOMAIN)
   {
      dictionaryKey = cm.Uri;
   }
   else
   {
      dictionaryKey = cm.Scope.ToString();
   }
   ContainerMember _containerMember = new ContainerMember(cm);
   this.containerMembers.Add(dictionaryKey,_containerMember);
}

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.