Partager via


AreaManager, classe (Microsoft.SharePoint.Portal.SiteData)

Obsolète.  

Manages areas.

Espace de noms : Microsoft.SharePoint.Portal.SiteData
Assembly : Microsoft.SharePoint.Portal (dans microsoft.sharepoint.portal.dll)

Syntaxe

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

Remarques

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.

Exemple

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");

Hiérarchie d'héritage

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

Sécurité des threads

Les membres statiques publics de ce type (Shared en Visual Basic) sont sécurisés au niveau des threads. Il n'est pas garanti que les membres d'instance soient sécurisés au niveau des threads.

Voir aussi

Référence

Membres AreaManager
Microsoft.SharePoint.Portal.SiteData, espace de noms