AudienceSiteCollection.AudienceSiteEnumerator Class
The AudienceSiteCollection.AudienceSiteEnumerator class enumerates sites in the AudienceSiteCollection class.
System.Object
Microsoft.SharePoint.Portal.Audience.AudienceSiteCollection.AudienceSiteEnumerator
Public Methods
The following table shows the methods of the AudienceSiteCollection.AudienceSiteEnumerator class and a brief description of each.
| Name | Description |
|---|---|
| MoveNext | Moves the enumerator to the next element of the collection. |
| Reset | Sets the enumerator to its initial position, which is before the first element in the collection. |
Public Properties
The following table shows the properties of the AudienceSiteCollection.AudienceSiteEnumerator class, the data type of each property, and a brief description of each.
| Name | Data type | Description |
|---|---|---|
| Current | object | Gets the current element in the collection. |
Thread Safety
The AudienceSiteCollection.AudienceSiteEnumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads could still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated, and the next call to MoveNext or Reset throws an exception. If the collection is modified between MoveNext and Current, Current returns the element that it is set to, even if the enumerator is already invalidated.
Requirements
Namespace: Microsoft.SharePoint.Portal.Audience
Platforms: Microsoft Windows Server 2003
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Security: Code Access Security