AudienceManager.GetAudienceIDs Method
Gets a list of AudienceNameID objects that correspond to the specified list of audience names.
Namespace: Microsoft.Office.Server.Audience
Assembly: Microsoft.Office.Server (in Microsoft.Office.Server.dll)
Syntax
'Declaration
Public Function GetAudienceIDs ( _
AudienceNameList As ArrayList _
) As ArrayList
'Usage
Dim instance As AudienceManager
Dim AudienceNameList As ArrayList
Dim returnValue As ArrayList
returnValue = instance.GetAudienceIDs(AudienceNameList)
public ArrayList GetAudienceIDs(
ArrayList AudienceNameList
)
Parameters
- AudienceNameList
Type: System.Collections.ArrayList
ArrayList object that contains audience names.
Return Value
Type: System.Collections.ArrayList
System.Collections.ArrayList object that represents a list of AudienceNameID objects.
Remarks
The GetAudienceIDs method retrieves an AudienceNameID object that corresponds to the list of audience names specified in AudienceNameList.
Examples
The following code example shows how to build an ArrayList of audience names and invoke the GetAudienceIDs method.
ArrayList AudienceIDList;
ArrayList AudienceNamelist = new ArrayList();
AudienceNamelist.Add("All");
AudienceIDList = AudMgr.GetAudienceIDs(AudienceNamelist);
if (AudienceIDList != null)
{
for (int i=0; i < AudienceIDList.Count; i++)
{
System.Console.WriteLine("{0}", i);
System.Console.WriteLine(((AudienceNameID)AudienceIDList[i]).AudienceID);
System.Console.WriteLine(((AudienceNameID)AudienceIDList[i]).AudienceName);
System.Console.WriteLine(((AudienceNameID)AudienceIDList[i]).bValid);
}
}