_IUccContactEvents.OnRemovedFromGroup 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 contact is removed from a group.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Syntax
'Declaration
Sub OnRemovedFromGroup ( _
pEventSource As UccContact, _
pEventData As UccGroupMembershipEvent _
)
void OnRemovedFromGroup (
UccContact pEventSource,
UccGroupMembershipEvent pEventData
)
void OnRemovedFromGroup (
UccContact^ pEventSource,
UccGroupMembershipEvent^ pEventData
)
void OnRemovedFromGroup (
UccContact pEventSource,
UccGroupMembershipEvent pEventData
)
function OnRemovedFromGroup (
pEventSource : UccContact,
pEventData : UccGroupMembershipEvent
)
Parameters
- pEventSource
A value of the IUccContact* (UccContact, for a .NET application) type. This represents the contact who is removed from a specified group.
- pEventData
A value of the IUccGroupMembershipEvent* (UccGroupMembershipEvent, for a .NET application) type. This contains the group from which the specified contact is removed.
Remarks
The IUccContact interface passed as the pEventSource parameter represents the contac that was removed from a group. The Groups property contains an updated collection of the contact's groups. The collection does not contain the group that the contact was removed from.
Win32 COM/C++ Syntax
HRESULT OnRemovedFromGroup
(
IUccContact* pEventSource,
IUccGroupMembershipEvent* 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 removes a group name from a List (cl). The client is excluding the "~" group membership of the given contact.
void _IUccContactEvents.OnRemovedFromGroup (
UccContact pEventSource,
UccGroupMembershipEvent pEventData)
{
IUccCollection groups = pEventSource.Groups;
if (groups.Count > 0)
{
StringBuilder groupNames = new StringBuilder();
foreach (IUccGroup g in groups)
{
if (g.Name != "~")
{
groupNames.Append(g.Name);
groupNames.Append(System.Environment.NewLine);
}
}
Console.WriteLine(
"group membership: " +
groupNames.ToString());
}
cl.Remove(pEventData.Group.Name);
}
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
_IUccContactEvents Interface
_IUccContactEvents Members
Microsoft.Office.Interop.UccApi Namespace