IUccProperty.Id Property

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.

Gets the ID of this property instance.

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

Syntax

'Declaration
ReadOnly Property Id As Integer
int Id { get; }
property int Id {
    int get ();
}
/** @property */
int get_Id ()
function get Id () : int

Property Value

A value of the LONG* (int, for a .NET application) type. This returns the ID of the property.

Remarks

The Id property of an IUccProperty instance is only initialized and filled when the property is created with a call to AddProperty.

Properties created by calling AddNamedProperty contain an un-initialized Id property. Accessing a named property Id raises a UCC_E_NOT_EXIST COM exception.

IUccProperty instances returned as property values exposed by Unified Communications Platform objects are identified by Id. The property instance Id corresponds to an enumerated value from enumeration appropriate to the property context. For example: UCC_CONFERENCE_PARTICIPANT_PROPERTY defines the possible property Id values returned in a collection in the context of a conference participant.

Win32 COM/C++ Syntax

HRESULT get_Id
(
   LONG* pPropertyId
);

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 Unified Communications Client API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example returns the numeric Id of a given property based on the collection index passed as a numeric index value.

public int CollectionPropertyItemId(IUccPropertyCollection pPropertyCollection, int pIndex)
{
   int returnValue = 0;
   if (pIndex < 1 || pIndex > pPropertyCollection.Count)
   {
      throw new ArgumentOutOfRangeException();
   }
   IUccProperty p = pPropertyCollection[pIndex] as IUccProperty;
   try
   {
      returnValue = p.Id;
   }
   catch (COMException e)
   {
      Console.WriteLine(e.ErrorCode.ToString());
   }
   return returnValue;
}

The following example handles a session related event raised by a client application. The IUccSessionParticipant argument exposes an IUccContext instance which in turn, implements IUccPropertyCollection. The get_Property method is called on the property collection with an enum representing the property Id of interest.

void aps_OnParticipantAdded(object sender, IUccSessionParticipant participant)
{
   //get property collection (context) from session participant
   IUccContext participantContext = participant.Context;

   //get display name property from property collection
   IUccProperty callerProperty = participantContext.get_Property(
      (int)UCC_CONFERENCE_PARTICIPANT_PROPERTY.UCCCPPID_DISPLAY_NAME);

   //fill local string with StringValue of obtained property
   string callerName = callerProperty.StringValue;
   Console.WriteLine(callerName + " accepted call");
}

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

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