Share via


AudienceManager.GetAudienceNames Method

Gets a list of AudienceNameID objects that correspond to the specified list of audience globally unique identifiers (GUIDs).

Namespace:  Microsoft.Office.Server.Audience
Assembly:  Microsoft.Office.Server (in Microsoft.Office.Server.dll)

Syntax

'Declaration
Public Function GetAudienceNames ( _
    AudienceIDList As ArrayList _
) As ArrayList
'Usage
Dim instance As AudienceManager
Dim AudienceIDList As ArrayList
Dim returnValue As ArrayList

returnValue = instance.GetAudienceNames(AudienceIDList)
public ArrayList GetAudienceNames(
    ArrayList AudienceIDList
)

Parameters

Return Value

Type: System.Collections.ArrayList
System.Collections.ArrayList object that represents a list of AudienceNameID objects.

Remarks

The GetAudienceNames method retrieves a list of AudienceNameID objects that correspond to the list of audience GUIDs specified in AudienceIDList.

Examples

The following code example shows how to build an ArrayList of audience GUIDs and invoke the GetAudienceNames method.

ArrayList AudienceIDList = new ArrayList();
ArrayList AudienceNameList;
AudienceIDList.Add(new Guid("00000000-0000-0000-0000-000000000000"));
AudienceIDList.Add(new Guid("53581B32-8A7A-430E-893C-157B40BF41FF"));

AudienceNameList = AudMgr.GetAudienceNames(AudienceIDList);

if (AudienceNameList != null)
{
    for (int i=0; i < AudienceNameList.Count; i++)
    {
        System.Console.WriteLine("{0}", i);
        System.Console.WriteLine(((AudienceNameID)AudienceNameList[i]).AudienceID);
        System.Console.WriteLine(((AudienceNameID)AudienceNameList[i]).AudienceName);
        System.Console.WriteLine(((AudienceNameID)AudienceNameList[i]).bValid);
    }
}

See Also

Reference

AudienceManager Class

AudienceManager Members

Microsoft.Office.Server.Audience Namespace