Export (0) Print
Expand All

UccPresenceContactCardAddress Class

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.

Illustrates the implementation of an address in a contact card. The class cannot be co-created.

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

public abstract class UccPresenceContactCardAddress
public abstract class UccPresenceContactCardAddress
public abstract class UccPresenceContactCardAddress

This class implements the IUccPresenceContactCardAddress interface. The default interface is IUccPresenceContactCardAddress. An application obtains the default interface on the class instance directly. Non-default interfaces, if any, can be obtained by calling QueryInterface on the default interface. This class cannot be co-created. It is intended to illustrate that the implemented interfaces can be queried from each other as well as the events raised in an instance of this class.

Win32 COM/C++ Syntax

coclass UccPresenceContactCardAddress
{
   [default] interface IUccPresenceContactCardAddress;
};

System.Object
  Microsoft.Office.Interop.UccApi.UccPresenceContactCardAddress

The two ways of obtaining an IUccPresenceContactCardAddress instance are illustrated in the following examples.

Obtaining an Address From an Existing Contact Card Address Collection

The following example iterates on the address collection of an IUccPresenceContactCardInstance instance. The example is drawn from an application class that wraps an IUccPresenceContactCardInstance (this._ContactCard).

/// <summary>
/// Iterate on an address collection to find an address object matching the 
/// passed address type
/// </summary>
/// <param name="phoneType">UCC_CONTACT_CARD_ADDRESS_TYPE type to find</param>
/// <returns>mathing UccPresenceContactCardAddress</returns>
public UccPresenceContactCardAddress GetAddressObject(UCC_CONTACT_CARD_ADDRESS_TYPE addressType)
{
    UccPresenceContactCardAddress returnValue = null;
    foreach (UccPresenceContactCardAddress address in this._ContactCard.Addresses)
    {
        if (address.Type == addressType)
        {
            returnValue = address;
            break;
        }
    }
    return returnValue;
}

Creating a New Address Instance

The following example method returns a new instance of IUccPresenceContactCardAddress of a given address type. The example is drawn from an application class that wraps an instance of IUccPresenceContactCardInstance (this._ContactCard).

/// <summary>
/// Creates a new instance of UccPresenceContactCardAddress. 
/// </summary>
/// <param name="pAddressType">UCC_CONTACT_CARD_ADDRESS_TYPE enumeration</param>
/// <returns>UccPresenceContactCardAddress of specified type</returns>
public UccPresenceContactCardAddress CreateNewAddressObject(
    UCC_CONTACT_CARD_ADDRESS_TYPE pAddressType)
{
    UccPresenceContactCardAddress returnValue = null;
    try
    {
        returnValue = this._ContactCard.CreateAddress(pAddressType);
    }
    catch (COMException e)
    {
        Utilities.HandleException<COMException>(
            "sampleUCCPClient.ContactCard CreateNewAddressObject(): COM Exception. ",
            e,
            this.showMessage);
    }
    return returnValue;
}

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

Show:
© 2014 Microsoft