IUccCollection 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.

Represents an enumerable collection of items.

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

Syntax

'Declaration
Public Interface IUccCollection
    Inherits IDispatch, IUnknown
public interface IUccCollection : IDispatch, IUnknown
public interface class IUccCollection : IDispatch, IUnknown
public interface IUccCollection extends IDispatch, IUnknown
public interface IUccCollection extends IDispatch, IUnknown

Remarks

This interface is used throughout the Unified Communications API set to represent enumerable collections of such types as IUccEndpoint, IUccSessionParticipant, IUccMediaDevice, IUccMediaConnectivityServer, IUccMediaChannel, IUccSignalingServer, IUccCategoryInstance, and IUccPresentity. This partial list represents the more commonly used collections.

An instance of IUccCollection is typically exposed as a property of an interface. For example, IUccSubscription exposes an instance of IUccCollection where the items in the collection are cast to the IUccPresentity interface.

IUccCollection exposes a property that holds the number of items in the collection as well as an enumerator that allows client code to iterate over the collection to process individual collection items.

Win32 COM/C++ Syntax

interface IUccCollection : IDispatch

Example

In the following example, the client has received an OnGetConferenceList event. The event is raised when the client has used an IUccConferenceManagerSession instance to request a list of conference sessions in which the local user is a participant. The example demonstrates the ability of the Unified Communications client platform to "nest" collections within other collections. In this case, the event data parameter exposes a read only collection that can contain a property representing a collection of conference information objects.

The example gets the single property representing the conference information collection out of the read only collection returned by the event handler parameter. The IUccProperty item from the read only collection must be cast to the IUccCollection interface in order to expose the collection iterator.

void _IUccConferenceManagerSessionEvents.OnGetConferenceList(
   UccConferenceManagerSession pEventSource,
   IUccOperationProgressEvent pEventData)
{
   IUccCollection myConferences = null;
   if (pEventData.IsComplete == true)
   {
      //obtain read only collection of event properties
      IUccReadOnlyPropertyCollection rp = pEventData.Properties;

      //verify the read only collection contains a conference list
      //an exception is thrown if get_Property is called to get
      //a property that is not in the collection
      if (rp.IsPropertySet((int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY.UCCCMOCEP_CONFERENCE_LIST))
      {

          //get the conference list collection as an IUccProperty
          IUccProperty p = rp.get_Property((int)UCC_CONFERENCE_MANAGER_OPERATION_COMPLETED_EVENT_PROPERTY.UCCCMOCEP_CONFERENCE_LIST);

          //cast the value of the Value property to the IUccCollection interface
          myConferences = p.Value as IUccCollection;
      }
      if (myConferences != null && myConferences.Count > 0)
      {

           // exposed collection enumerator iterates the collection
           foreach (IUccProperty thisConference in myConferences)
           {
               UccConferenceInformation ci = null;
               ci = thisConference.Value as UccConferenceInformation; 
               if (ci != null && ci.ConferenceUri != null)
                   Console.WriteLine(
                      "Conference Uri: " +_
                      ci.ConferenceUri.UserAtHost);
           }
      }
   }
}

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

IUccCollection Members
Microsoft.Office.Interop.UccApi Namespace