AudienceManager.Audiences AudienceManager.Audiences AudienceManager.Audiences Property

Definition

Gets the collection of Audience objects for the current site.

public:
 property Microsoft::Office::Server::Audience::AudienceCollection ^ Audiences { Microsoft::Office::Server::Audience::AudienceCollection ^ get(); };
public Microsoft.Office.Server.Audience.AudienceCollection Audiences { get; }
Public ReadOnly Property Audiences As AudienceCollection
Property Value

AudienceCollection collection of Audience objects that are associated with the current site.

Examples

<p>The following code example shows how to retrieve and list information for audiences associated with a site.</p>
<pre><code>AudienceCollection Audiences;

AudienceManager AudMgr = New AudienceManager(); Audiences = AudMgr.Audiences;

for (int list=0; list &lt; Audiences.Count; list++) { System.Console.WriteLine("{0}", list); Audience = (Audience)Audiences[list]; System.Console.WriteLine(" Audience.Count ", Audience.Count); System.Console.WriteLine(" Audience.AudienceCompiledSofar ", Audience.AudienceCompiledSofar); System.Console.WriteLine(" Audience.LastCompileStartTime ", Audience.LastCompileStartTime); System.Console.WriteLine(" Audience.LastCompileStartTime ", Audience.LastCompileFinishTime); System.Console.WriteLine(" Audience.LastCompileError ", Audience.LastCompileError); System.Console.WriteLine(" Audience.CompileInProgress ", Audience.CompileInProgress); } System.Console.WriteLine("End");

Dim Audiences As AudienceCollection
Dim AudMgr As New AudienceManager()
Audiences = AudMgr.Audiences

For list As Integer = 0 To Audiences.Count - 1
    System.Console.WriteLine("{0}", list)
    Audience = CType(Audiences(list), Audience)
    System.Console.WriteLine("  Audience.Count ", Audience.Count)
    System.Console.WriteLine("  Audience.AudienceCompiledSofar ", Audience.AudienceCompiledSofar)
    System.Console.WriteLine("  Audience.LastCompileStartTime ", Audience.LastCompileStartTime)
    System.Console.WriteLine("  Audience.LastCompileStartTime ", Audience.LastCompileFinishTime)
    System.Console.WriteLine("  Audience.LastCompileError ", Audience.LastCompileError)
    System.Console.WriteLine("  Audience.CompileInProgress ", Audience.CompileInProgress)
Next list
System.Console.WriteLine("End")

Remarks

The Audiences property is read-only. This property does not require the user to be a member of the Administrator site group for Microsoft Office SharePoint Server 2007.

Applies to