Share via


AreaManager Class

NOTE: This API is now obsolete.

Manages areas.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Portal.SiteData.AreaManager

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

Syntax

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

Remarks

Areas are classifications for grouping content by user-defined criteria.

If a user instantiates a keyword area to call an AddKeyword or RemoveKeyword method, the user must acquire the keyword instance by using the SystemArea.Keyword object.

Examples

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

Private siteUrl As New Uri("https://server/")
Private tm As New TopologyManager()
Private site As PortalSite = tm.PortalSites(siteUrl)
Private portalContext As PortalContext = PortalApplication.GetContext(site)
      
' get the topics area
Private guidTopics As Guid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Topics)
Private areaTopics As Area = AreaManager.GetArea(portalContext, guidTopics)
Uri siteUrl = new Uri("https://server/");
TopologyManager tm = new TopologyManager();
PortalSite site = tm.PortalSites[siteUrl];
PortalContext portalContext = PortalApplication.GetContext(site);

// Get the topics area
Guid guidTopics = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Topics);
Area areaTopics = AreaManager.GetArea(portalContext, guidTopics);

Following is an example that acquires the keyword instance.

TopologyManager topologyManager = new TopologyManager();
Uri uri = new Uri("http://MyPortal");
PortalSiteCollection sites = topologyManager.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid keywordGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Keyword);
Area keywordArea = AreaManager.GetArea(portalContext, keywordGuid);
keywordArea.AddKeyword("String1");

Following is an example that does not acquire the keyword instance.

TopologyManager topologyManager = new TopologyManager();
Uri uri = new Uri("http://MyPortal");
PortalSiteCollection sites = topologyManager.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid homeGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Home);
Area homeArea = AreaManager.GetArea(portalContext, homeGuid);
AreaCollection subareas = homeArea.Areas;
Area keywordArea = subareas["Keywords"];
keywordArea.AddKeyword("String1");

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

AreaManager Members

Microsoft.SharePoint.Portal.SiteData Namespace