Share via


AreaCollection Class

NOTE: This API is now obsolete.

Manages areas.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Portal.SiteData.AreaCollection

Namespace:  Microsoft.SharePoint.Portal.SiteData
Assembly:  Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Syntax

'Declaration
<ObsoleteAttribute("This class is obsolete.")> _
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class AreaCollection _
    Implements IEnumerable
'Usage
Dim instance As AreaCollection
[ObsoleteAttribute("This class is obsolete.")]
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class AreaCollection : IEnumerable

Examples

The following code example shows the use of the AreaCollection class.

AreaCollection areasTopics = areaTopics.Areas;

for (uint i = 0; i < areasTopics.Count; i++)
{
Console.WriteLine(areasTopics[i].Title);
}

foreach (Area area in areasTopics)
{
Console.WriteLine(area.Description);
}

// add a new area
Area areaNew = areasTopics.AddArea("New area title");
Console.WriteLine(areaNew.Title);

// remove the newly created area
areasTopics.RemoveArea(areaNew.ID);

// recreate it
areaNew = areasTopics.AddArea("New area Title");

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

AreaCollection Members

Microsoft.SharePoint.Portal.SiteData Namespace