_IUccContainerEvents.OnMemberAdded Method

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.

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)

Syntax

'Declaration
Sub OnMemberAdded ( _
    pContainer As IUccContainer, _
    pEventData As UccContainerMemberCollectionEvent _
)
void OnMemberAdded (
    IUccContainer pContainer,
    UccContainerMemberCollectionEvent pEventData
)
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.

Remarks

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
);

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 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);
}

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

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